← Articles
Artificial Intelligence
Cover of article Demystifying artificial intelligence: from classical engineering to large language models

Demystifying artificial intelligence: from classical engineering to large language models

Understand how control systems help explain neural networks, training, tokens and AI-generated responses.

By Custodia Systems ·

Artificial intelligence impresses us with its ability to interpret text, develop software and analyze documents. But how does it work? We can start with a concept used in engineering for decades: automatic control systems. 1. Controlling a car's speed Imagine a driver setting a speed of 100 km/h. When the car encounters an uphill slope, the system detects the loss of speed and increases acceleration. Downhill, it reduces acceleration. In engineering, a transfer function describes how a linear system responds to inputs over time. The controller receives information about the desired and current speeds, performs mathematical operations and determines a corrective action. Depending on the chosen parameters, the car may respond smoothly, slowly or abruptly. Changing parameters can modify behavior without necessarily changing the system's structure. 2. From a simple function to a network of functions Imagine also considering the road gradient, vehicle weight and wind. Each piece of information can have a different importance, called a weight. Now imagine thousands or millions of interconnected operations, whose results feed other operations. This is a simplified way to understand artificial neural networks. Successive processing layers combine mathematical operations and adjustable parameters. Large language models can have billions or hundreds of billions of parameters. A model labeled 7B has approximately seven billion parameters. These are not necessarily seven billion independent functions. 3. How does artificial intelligence learn? To tune a controller, we could test the car under different conditions and modify its parameters whenever the result was unsatisfactory. Language model training uses a conceptually similar principle on a much larger scale. Imagine presenting the sentence “The capital of Brazil is...”. The model tries to predict the continuation. Algorithms calculate the error relative to the expected result and adjust parameters to improve future predictions. This procedure is repeated countless times over large volumes of texts, documents, books and code. Gradually, the model learns patterns and relationships. Developers do not need to program every response individually. 4. What are tokens? To process text mathematically, we need a numerical representation. The process begins with tokenization. A token can represent a word, part of a word, a space, punctuation or another sequence of characters. In a hypothetical vocabulary, “car” might correspond to number 125; “speed” to 340; “road” to 782; and “engine” to 921. These identifiers are subsequently converted into numerical vectors called embeddings. A word such as “automatically” might be divided into “automatic” and “ally”. The division depends on the tokenizer used. This is why many AI services charge according to the number of tokens processed, rather than the number of words or questions. 5. How does artificial intelligence generate a response? Text is divided into tokens and converted into numerical representations. This information passes through the neural network layers using learned parameters. Finally, the model calculates probabilities for the next tokens. Given the sentence “The driver turned on the...”, possible continuations include “engine”, “car”, “radio” or “headlights”. After selecting a token, the model incorporates it into the context and repeats the process until the response is complete. This is why we often see text being progressively constructed on the screen. 6. The difference between training and use During training, parameters are continuously adjusted. This can require thousands of specialized computing devices, large volumes of data and energy. Once trained, the model can be used without repeating this process. This stage is called inference. Parameters normally remain fixed. Thus, some models trained on large computing infrastructures can run on personal computers. Artificial intelligence does not necessarily learn something new permanently from every conversation. 7. Why can artificial intelligence make mistakes? A coherent and convincing response may contain incorrect or nonexistent information. This phenomenon is known as hallucination. In scientific, legal, forensic and investigative activities, AI can help locate information, identify patterns and interpret data. However, its conclusions must be checked against original sources. Conclusion As in classical control systems, we have inputs, mathematical operations, adjustable parameters and outputs. The difference lies in architecture, scale and training. While a simple controller may use only a few parameters, a large language model uses billions. Relatively simple operations, combined on an extraordinary scale, can produce complex behaviors. Behind this apparent intelligence lie mathematics, engineering, computing power and decades of scientific progress.

Explore articles →

We respect your privacy. You can accept or decline optional cookies, according to our Privacy Policy.

By accepting, you authorize all cookies described in the policy. If you decline, we keep only necessary cookies. You can change your choice in the footer.