Transformations

kukkeliskuu1 pts1 comments

Transformations

Home

About

Blog

Contact

Info

Search

Search for Blog

3 min read

Jun 28, 2026

Transformations

Mikko Ahonen

in

django<br>django -->

postgres<br>postgres -->

We often talk about LLMs in terms of reasoning and generation. I have found it more helpful to think in terms of transformations and semantic layers. There appears to be some general principles that I have not found explicitly expressed elsewhere, on the relationship between semantic layers and transformations. Understanding them helps us to build more reliable systems with the help of LLMs.

The general principle could be expressed as:

The transformations available to a system are bounded by the semantics explicitly represented<br>in its internal model.

Take as an example, a platform for creating training videos. If all you have is the recorded video,<br>automating the postprocessing (such as highlighting the clicked element) is almost impossible. You would need<br>to analyze the content to understand what is going on, which is not reliable.

Now suppose the system producing the training videos also knows where the buttons, dialogs and forms are.<br>It can automatically zoom to the correct button, highlight a dialog, or keep an entire form visible.

The difference is in semantic representation.

If you add another semantic layer, and instead of UI elements, you make the systems aware about the actions<br>available, for example that clicking a certain button is related to action Create a Customer. Now it becomes<br>possible to create an user guide, full training videos etc.

This leads to a simple second principle:

Each additional semantic layer enlarges the space of valid, automatable transformations.

I think this principle shows up in many places in software development cycle. Compilers go through<br>multiple intermediate representations when transforming a C program to executable. Browsers build DOM<br>as an intermediate representation, instead of rendering the pixels directly.

These intermediate representations are partly done for architectural considerations, to make systems<br>more maintainable. But they also appear to be fundamental in what transformations are feasible.

We can think of LLMs as semantic transformers that transform from one representation into another.

In software development, requirements are transformed into user stories, user stories are transformed<br>into domain models, domain models are transformed to APIs, APIs arre transformed to code, code is<br>transformed to tests. The quality of each transformation depends on how much of the semantics is explicit.

If a LLM receives a well-defined domain model and an API specification, generating code is mostly<br>a direct transformation problem. If you prompt the LLM with “build me a CRM”, it has to invent a domain model,<br>workflows, APIs and architecture before it can write the code. In other words, it is filling the<br>gaps.

As LLMs have been trained on lots of code, this sometimes produces working software. But it can also<br>hallucinate or invent new requirements or features that were not there.

The reliable use of LLMs maximizes explicit semantic representations and minimizes transformations that<br>rely solely on implicit semantic knowledge.

The key word here is reliable. LLMs have implicit semantic knowledge encoded in their weights. That’s why<br>they can and do invent what is missing to be able to complete their goal. These invented semantics<br>are probabilistic.

Explicit semantics are constraints. The more meaning that is represented in the requirements,<br>the more LLM becomes a reliable transformer instead of an inventor. It seems that for succesful use of<br>LLMs, you need to have a taste for rich, meaningful semantic representations, and how these can interact well.

Learning LISP languages is often said to change your approach to programming in any language. One of these<br>changes is that you start to think in terms of DSLs. Instead of imperatively developing the software, you envision a<br>DSL that would be perfect for writing your program. Then you write the program in that language. Finally you<br>implement that language. That is actually very useful way to approach LLM use.

If you need consulting related to system architectures in general, or LLMs or data integrations in<br>particular, please do not hesitate to contact Mikko Ahonen through the contact page.

Previous Post

Adding a unique constraint to a Django model

You may also like

4 min read

Aug 15, 2024

Adding a unique constraint to a Django model

Adding a unique constraint to a Django model with lots of data when using Postgres

Mikko Ahonen

in

django<br>django -->

postgres<br>postgres -->

Latest Posts

3 min read

Jun 28, 2026

Transformations

Mikko Ahonen

4 min read

Aug 15, 2024

Adding a unique constraint to a Django model

Mikko Ahonen

Get Interesting News

Subscribe to the newsletter and I’ll send you the emails of latest posts.

Email address

Join

transformations semantic django llms model mikko

Related Articles