In his monograph, “Engineering intelligence, minds, and cognition”, HTEC head of artificial intelligence, Igor Ševo, examines how businesses and society can move beyond basic artificial intelligence (AI) applications and plan for a future where AI evolves into a collective “general intelligence.”
Igor’s work covers a wide range of AI topics including how to improve LLM training for better communication. You’ll find an in-depth breakdown of this process in the “Negotiating Interfaces” section of the monograph.
AI tools are learning how to solve problems, adapt to situations, and make decisions at the level of human cognition. This is commonly referred to as artificial general intelligence (AGI), which may be achieved next year or sometime in the next 25 years, depending on which AI expert you ask.
Igor Ševo emphasizes in his monograph that to keep pace with the march toward AGI, large language models (LLMs) — which we use to generate responses in chatbots and virtual assistants — must progress beyond basic text generation and turn-based conversations to enable more interactive communication between humans and AI agents.
In this blog post, we’ll highlight some of the key methods that can be used to train LLMs for a world where AI thinks, responds, and interacts like a person.
Fine-tuning LLMs with message types
LLMs can be fine-tuned to improve conversations in specific use cases by assigning message types that define the roles and functions in a conversation. The common message types are “system,” “user,” and “assistant” and each can be used to help models follow instructions, obey rules, and respond appropriately.
For instance, in a customer support chatbot, the “system” sets the conversation context (“You are a customer support assistant”), the “user” provides requests (“I need help getting a refund”), and the “assistant” makes sure the chatbot responds to the user with correct information in an orderly and helpful way.
The main business benefit of assigning message types within an LLM is that responses will be more accurate and consistent. When each message type is pre-defined and has a clear function, the model follows a logical pattern when responding to queries, reducing the chances of ambiguous or contradictory answers.
Function messages in APIs
A “function message” in an API-based LLM is essentially a command to interact with an external API so the model can perform actions beyond just generating text.
Function messages are important because they help generate more accurate and relevant responses. Instead of guessing at answer when it doesn’t have access to enough information, the LLM can access real-time external data through API calls and deliver a much more comprehensive answer.
Consider the following example. A user asks an API-based LLM (via a chatbot), “What is the current weather in Belgrade, Serbia?” The LLM receives the query and identifies that it does not have built-in real-time access to weather data and needs external data. The LLM then constructs a function call request to an external weather API. The weather API processes the request and returns real-time weather data for Belgrade.
Essentially, function messages allow LLMs to switch from passive responders into active assistants by allowing them to interface with external systems dynamically.
Specialized tokens for multi-agent systems
In multi-agent systems, independent AI agents are powered by individual LLMs. These agents collaborate with one another to solve complex tasks, and specialized tokens (unique symbols that organize inputs and data like “user-0” and “user-1”) can help identify different agents interacting within the same system. Specialized tokens can be used to reduce redundancy and streamline communication between agents.
For instance, in a collaborative coding environment, one agent (user-0) writes code, while another agent (user-1) reviews the code, and a third agent (user-2) tests the code. Using specialized tokens clarifies each agent’s role, while saving computational resources.
XML’s role in enhancing LLM outputs
Extensible markup language (XML) is a method for organizing data using tags. While XML does not play a crucial role in the current generation of LLMs, in the near-future it could be used to expand AI beyond turn-based conversation by giving structure to information, improving collaboration between AI agents, and building user interface (UI) design elements.
Structured communication and collaboration with XML
Unlike simple message tags that categorize text without details about meaning or intent, XML embeds attributes such as intent and role to give an LLM a clearer understanding of what a user wants.
Here’s a code example of how XML could improve the efficiency of an LLM when a user asks for IT support. Instead of tagging a message as just “user,” the model structures it as:
<message role=”user” intent=”request_help”>
“I need help resetting my password”
</message>
The intent attribute (“request_help”) makes the purpose of the user’s query clear to the model, leading to more relevant responses.
XML could also help structure communication when multiple AI agents are working together (co-editing a research report, troubleshooting software). Using XML-based shared structures like a Document Object Model (DOM), agents could collaboratively read or write to parts of a shared document.
In a document-editing tool such as Grammarly, for instance, one agent could correct grammar while another formats the text. Both agents interact with a shared XML document, modifying only their respective sections.
XML as user interface design tool
In addition to leveraging XML to improve LLM communication and agent collaboration, experts may soon be able to train LLMs to use XML to build user interface (UI) elements such as buttons, sliders, and forms.
For example, a user may ask a travel booking chatbot, “I want to find flights to Chicago next Tuesday.” Instead of explaining in text how to search for flights, the LLM would use XML to generate code that builds a date picker and a “search flights” button, making the process seamless.
XML’s ability to build UI elements would make the user experience much more intuitive and natural. As next-generation LLMs’ become more adaptable, they will be able to switch between text-based responses and interactive UI elements based on what works best.
Taking this adaptability even further, LLMs trained with XML could generate adaptive user interfaces (UIs) — often referred to as “negotiated interfaces” — that adjust in real-time based on the flow of the conversation or task.
For instance, in a graphic design chatbot, if the user prompt is, “I want a larger font,” instead of sending text instructions, the model could use XML to generate a slider to adjust font size. If the user then requests a “green background”, the model could build a color slider to change the color. The interface adjusts dynamically to the task at hand.
The future of AI-driven interfaces and LLMs
The evolution of LLMs is paving the way for dynamic interfaces that adapt to conversations as they unfold. Current generation LLMs are not yet built for this level of generality, but by training future models for structured communication and UI design, LLMs could soon switch smoothly between chat, UI generation, and collaboration.
This approach facilitates more natural human-machine interactions while also bringing us closer to general intelligence, where AI adapts its communication style and tools to solve problems with human-like intelligence.
In an ecommerce environment, this could play out with a customer support chatbot that dynamically generates UI elements based on the conversation. If a customer asks about a delayed order, the AI presents a real-time package tracking panel instead of just text responses. This showcases how LLMs can go beyond text-based dialogue and generate interactive UI components on demand.
The future of AI is about more than text-based conversation. It’s about creating the right interface at the right time.
For enterprises looking to broaden their AI usage, HTEC is actively helping clients pilot and deploy production-ready AI solutions across their organizations ethically and securely.
Ready to discover how HTEC’s AI and data science expertise can support your business strategy? Connect with Igor and other HTEC AI experts.