LLM’s and Data Science
The Large Language Model (LLM) extends beyond the realms of traditional statistical tools and generative AI technologies, heralding a revolutionary paradigm in software engineering. This article delves into how the LLM transcends its roots in data science to redefine software development, while sharing reflections on how I recalibrated my software engineering mindset to navigate this transformative landscape.
The LLM OS
It is often forgotten that the field now known as computer science was originally termed "data science,"1. This historical perspective is important when considering the role of the LLM in the landscape of software. Data remains central to software. Writing good applications, particularly on the web, is fundamentally about the efficient storage and manipulation of data; text messages, images and videos, currency and transactions, likes, and dislikes.
It would be inaccurate to claim that the LLM will reunite Data Science and Software Engineering. Nevertheless, to discard the LLM as a statistical toy and demarcate it from true software engineering would be limiting. Like most useful science originating in a ‘lab’, we should eagerly track its transition from theoretical science into practical engineering.
Andrej Karpathy is rapidly gaining recognition as a leading contemporary computer scientist. With hands-on experience developing innovative technologies at Tesla and OpenAI, he is now focusing more on pioneering through experimentation and intellectual leadership.
One of Kaparthy’s most fundamental ideas is that the LLM will become a central component of software engineering, proposing a new paradigm known as the ‘LLM OS’. Serving at the same level of importance as the database or the web server, Kaparthy posits the LLM as a pivotal component in the evolving landscape of modern software architecture.
The details.
Before any good engineering can be done with the LLM, it is important to critique it from first principles.
Next word prediction
LLMs thrive on the colossal datasets—language corpuses that provide the raw material from which they learn. LLM’s read trillions of words, and eventually, they may be able to predict the next one. They do not reason, perform arithmetic, or answer questions. Their billions of parameters go towards optimizing one single function: predicting the next word2 given the previous. It is as a ‘side effect’ of predicting the next word* that these emergent behaviors are realized. Here is a fiery Reddit post I stumbled across which I think explains it best3:
(In response to a question ‘When will LLM’s figure out mathematics’)
“…It [the LLM] does not explicitly model reasoning nor any part of the world, but since language itself has been used to describe reasoning and systems in the real world, it manages to capture the shadows of them in its probability density functions…”
Hallucination
Many do not realize the degree of unstructured-ness that seed the breeding of these LLM’s. Indeed, another legendary quote from Kaparthy reads:
I always struggle a bit with I’m asked about the “hallucination problem” in LLMs. Because, in some sense, hallucination is all LLMs do. They are dream machines.
We direct their dreams with prompts. The prompts start the dream, and based on the LLM’s hazy recollection of its training documents, most of the time the result goes someplace useful.
It’s only when the dreams go into deemed factually incorrect territory that we label it a “hallucination”. It looks like a bug, but it’s just the LLM doing what it always does.
In engineering terms, hallucination is neither a bug, nor a ‘side effect’, but the sole and core function of the LLM.
Compute
The cornerstone of modern LLMs is the transformer architecture, introduced by Google researchers in the seminal paper "Attention Is All You Need."4 This innovation allows for the parallel processing of language, a stark departure from the linear, sequential constraints of previous models like LSTMs and RNNs. This shift not only improves efficiency but also enhances the machine's ability to understand language by processing multiple words simultaneously, rather than one by one.
This approach eliminates the need for temporal sequencing, enabling LLMs to handle vastly larger contexts and perform more complex tasks. The real power of transformers lies in their compatibility with modern GPUs and cloud computing infrastructures, which support this parallel processing at scale. It is this synergy between advanced machine learning models and robust computational power that enables platforms like chatgpt.com to deliver swift and seamless user interactions. The magic experienced by users is the direct result of this complex orchestration, where sophisticated statistical models meet high-performance computing to generate predictions.
LLMs are the confluence of beautiful statistical models, and legendary compute which enables these predictions.
Reconstruct
In the previous section, it was necessary to demean the LLM and to expose its internal engine: a function which accepts text (input) and returns the text most likely to follow (output). Any subsequent ‘intelligence’ is merely emergent behaviour, and all subsequent utility is merely an abstraction. So in order to engineer the LLM into systems able to serve more inputs and outputs, it is necessary to nullify one’s expectations. For example, even ChatGPT, a question-answer service, is just an exploitation of this ‘text continuation’ mechanism. Just try to build your own chatbot - you will quickly realize that you have to re-insert the entire conversation history each time just to get the next reply. And once you accomplish this, be cognizant that there are still many more hidden abstractions which enabled your chat bot. No LLM comes ‘out of the box’ with the ability to answer questions, or do anything other than only to predict the next word.
Only once we have understood all of the prior may we permit ourselves to embrace these abstractions and harness the extraordinarily useful tool that is the LLM.
The LLM OS (Again)
If you have read this far, you have stuck by the LLM at its worst, so now you deserve it at its best. A common pattern emerging in LLM applications is that the LLM acts as an operating system. It executes instructions, determines control flow, and handles data storage 5 (all of this, just from predicting the next word!)
If you have, as in the previous section, successfully distilled your interpretation of the LLM down to being a next word predictor, it shouldn’t come as a surprise that many technologists (Kaparthy, Andreessen, to name a couple) believe it inaccurate to think of LLM’s as a merely “chatbot”.
To Kaparthy, the LLM may become the “kernel process of an emerging operating system, coordinating resources such as memory or computational tools for problem solving.” 6. This is a large upwards climb in abstraction, so bear with me.
We can build our mental wireframe by first drawing on the equivalences. Most of these equivalences lie in the analogy of the “memory hierarchy”. If the LLM is like the kernel process of an operating system, then…
Disk is to The Internet (which is accessible through browsing)
RAM is to context window (maximum number of words needed to predict the next word in a sequence)
I/O is to RAG7, function calling, and multimodality (images, video, audio)
The analogy continues effortlessly into the emergence of proprietary vs open source LLM’s**...
Proprietary: Windows and Mac is to OpenAI and Claude
Open-Source: Linux is to LLaMa, BERT, etc…8
Then there are the corollaries, such as the idea of user space vs. kernel space applying also to LLM’s. What part of the LLM’s I/O should the user have privileged access to; i.e an enterprise LLM should never leak its internal prompts.
Building towards the LLM OS
To be honest, I didn’t truly understand the motivation behind the LLM OS, nor how to apply it to my own work, so I set out on a reckless journey of trial and error.
It wasn’t until I began to build that I realized the space of all LLM creations was actually more tightly constrained than I thought. Entering this seemingly unlimited space of potential projects, web-apps and money-making schemes can be dizzying, but only through experimentation do you begin to feel out the framework (the LLM OS) within which the majority of good ideas lie.
Trivial LLM applications utilize the LLM as the core of the product rather than the kernel process. Examples include ChatGPT, or Github Copilot. These applications are lucrative, but their transparency makes them highly competitive territory.
So I entertained the low hanging fruit first; products which purely leveraged the LLM’s text generation and conversational abilities. This included applications with a similar flavor to Duolingo, or schemes such as writing books. Yet the end result always seemed to lack substance, and fell short of being actually useful.
Letting my commercial brain rest for a second, my first creative LLM application was a small macro which sent an automated message to my girlfriend every day. Unbeknownst to me, this first attempt had landed very close to a realisation of an LLM OS. It pulled emojis and text into memory, augmented its generation using a weather fetching API, directed peripheral devices (my Macbook) in order to send messages, and integrated with software tooling (Scheduler) in order to execute more than once.
Mistakenly believing that I needed to hone my understanding of the fundamentals, I attempted to operate closer to the underlying weights and biases, fine tuning GPT-3 on my personal dairy.
I continued on this wild tangent, simulating a neural net with water simulations.
Getting back on track, I used OpenAI’s new function calling feature (another abstraction) to help me redesign my bedroom.
At ML/AI Hack 2023, I got closer, using an LLM to interface with the Public Transport Victoria API.
At UniHack 2024, I started to nail it, embedding an LLM with a project management suite to communicate with team members and prioritize tasks across the project, and taking home 1st place.
Eventually joining a startup, Lyrebird Health - a medical data software provider - as the lead machine learning engineer, applying what I knew about the LLM OS.
If you had known about the App Store in 2008, you might have predicted the explosion of app-driven businesses, new models of software distribution, and the shift toward a mobile-first computing environment. Understanding the LLM OS allows us to foresee a similarly transformative paradigm-shift in the next generation of software.
word ≈ token
Weng, 2023; Shen et al., 2024
Intro to Large Language Models - Andrej Kaparthy [YouTube]
Note that many ‘open source’ models aren’t truly open source, and instead are more akin to “tossing over a binary for an operating system.” - Andrej Kaparthy, at a Sequoia Capital talk

