Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

DelphiDemoShowcaseWindows

Build A Tiny, Explainable Language Model Entirely In Delphi

Developer Paul Toth has released MiniLLM, an experimental language model implemented entirely in Delphi without neural networks, GPUs, external dependencies, or machine-learning frameworks.

Instead of using a transformer architecture, MiniLLM combines PMI-based word embeddings, a weighted Markov transition graph, a recurrent context vector, and similarity-based scoring. It generates multiple candidate responses and reranks them using semantic similarity, transition coherence, repetition penalties, and anti-loop heuristics.

The result is a small, deterministic, and fully inspectable language model that can learn from a compact text corpus, understand simple questions, and generate coherent responses. Its deliberately straightforward Object Pascal code also makes the project useful for exploring how tokenization, embeddings, contextual scoring, and text generation work under the hood.

MiniLLM is designed to be hacked and extended, with room for larger corpora, multilingual support, syntactic tagging, custom scoring functions, improved reranking, and model import or export.

See how far a transparent, neural-network-free language model can go with pure Delphi.



Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
ComponentDelphiDemoFiremonkeyLibraryWindows

Run Google's Gemma 4 Vision Models Natively In Delphi

AndroidComponentDelphiDemoFiremonkeyIOSLinuxOSXShowcaseWindows

Experience ChatGPT As A Native Cross-Platform Firemonkey Application

DelphiLibraryWindows

Run Large Language Models Entirely On The GPU With Delphi And Vulkan

Code SnippetDelphiDemoLibraryWindows

Add Real-Time AI Voice Conversations To Windows Applications

Sign up for our Newsletter and
stay informed
[mailpoet_form id="1"]

Leave a Reply