A future with millions of small language models
Andrej Karpathy has described a future in which AI systems resemble companies. Many specialists do familiar jobs, and the hardest questions go to the people best equipped to answer them. In his discussion of small models on No Priors, he asks how small a “cognitive core” could be if it knew how to use tools and look things up.
Think about what goes into a calendar assistant. One small language model interprets “after lunch.” Another knows that you protect Fridays for writing. A third recognizes an invitation that needs an answer today. Two people using the same calendar could have different models because they have different ideas of a good week.
Now extend that idea to every application, user, and device. A model in a game needs to know the actions its characters can take. A model in a company needs to know that company's tools and policies. Where will all these specialists come from?
Our answer is to train large models to generate small models. I described this vision in From AI as Problem Solver to AI as Tool Builder. In Program-as-Weights (NeurIPS 2026), we built a compiler that takes a description of a task and generates the weights for a specialist that performs it.
From generating answers to generating models
Ask a coding agent to write a sorting function. It gives you code. You can sort a million lists without asking the agent to solve the sorting problem again.
Now ask it to write a function that picks out the messages you need to answer today. The word “urgent” is a poor rule. “No rush, but payroll closes at four and we need your signature” asks for action. “Yesterday's urgent payment went through” does not. We can describe the distinction in a sentence. Writing rules that recognize all the ways people express it is a different matter.
Developers often put a language-model call inside a function like this. Every new message goes back to the large model. What if the model could generate a reusable neural function as easily as it generates a Python function?
A single application can use both kinds of software. The neural function reads a message and decides whether it needs a reply. Ordinary code looks up the sender, checks the calendar, and schedules the reminder. The dates, permissions, and delivery time stay under the application's control.
How a large model generates a small specialist
Program-as-Weights specifically trains a neural compiler to generate the weights of other models. The developer writes a natural-language function specification. A 4-billion-parameter model prepares a runtime prompt. A trained 4-billion-parameter compiler reads the task and that prompt and generates a set of low-rank adapter weights, called a LoRA. PAW packages the prompt and the adapter together in a .paw file.
The interpreter is a frozen Qwen3-0.6B model. Loading a different adapter changes the function it performs. A laptop can store programs for recognizing deadlines, extracting commands, and reviewing logs while keeping one copy of the interpreter. A Standard program takes about 22 MB. The example below gives the exact size of each file.
The compiler learned how to generate adapters across the tasks in FuzzyBench. For a new task, Standard compilation generates the adapter weights directly, in seconds. For tasks that need more training, our Compile by Training method uses a teacher to generate examples and trains a task-specific adapter on them.
A network that produces another network's weights is called a hypernetwork. PAW uses this idea to turn a developer's words into an executable function. To see how the weights change an interpreter's behavior, try the interactive text-to-adapter lesson or read the compiler and interpreter guide.
Generate a small model for your application
Two note-taking apps have different search commands. Tell each one “Find my notes about the NeurIPS poster.” Both need to understand the same request. The right answer depends on which app will execute it.
Choose an app to see its specification, generated program, and response. Change the command in the specification and compile a new specialist. Change the search topic in the input to try the same specialist again.
- Program ID
60a4eae6a6408e692bd7- Compiler
paw-4b-qwen3-0.6b-20260407- Compilation
- 4.47 s
- File size
- 22,740,014 bytes
Output
search_notes("NeurIPS poster")
Run this input locally
Install the SDK and download the interpreter on the first run. The second call runs offline on your CPU.
# Install once:
# python -m pip install programasweights==0.4.14 --extra-index-url https://pypi.programasweights.com/simple/
from pathlib import Path
from urllib.request import urlretrieve
import programasweights as paw
bundle = Path("60a4eae6a6408e692bd7.paw")
if not bundle.exists():
urlretrieve("https://programasweights.com/api/v1/programs/60a4eae6a6408e692bd7/download", bundle)
with paw.function(str(bundle.resolve()), n_gpu_layers=0) as specialist:
print(specialist("Find my notes about the NeurIPS poster."))
with paw.function(str(bundle.resolve()), offline=True, n_gpu_layers=0) as specialist:
print(specialist("Find my notes about the NeurIPS poster."))
· Download the Python runner
Run the downloaded weights locally
Download either application’s .paw file and open “Run this input locally” for its Python example. The first run downloads the shared interpreter. Subsequent runs use the program and the interpreter on your computer.
| Request | App A | App B |
|---|---|---|
| Find my notes about the NeurIPS poster. | search_notes("NeurIPS poster") | find("NeurIPS poster", "notes") |
| Look up my notes on train tickets. | search_notes("train tickets") | find("train tickets", "notes") |
| Search my notes for the quarterly budget. | search_notes("quarterly budget") | find("quarterly budget", "notes") |
Build an AI agent from generated models
A coding agent reads an issue, selects a tool, scans the build log, and checks whether the change worked. These are different jobs. The tool selector needs the available commands and their arguments. The log reader needs to recognize the first error that explains a failure. Neither needs the whole conversation that led up to the build.
Give each specialist a job description, inputs, and an output the application knows how to use. Ordinary software calls the functions in the required order, validates the output, and hands unfamiliar cases to a generalist. When the team changes its tools, it can replace the tool selector and keep the log reader.
We used this division of labor in the paper's tool-calling example. Ten PAW functions determine whether a request needs a tool, select the tool, or extract arguments such as a location or stock ticker. Python parses dates and constructs the JSON call. The pipeline scored 93% on ToolCall-15.
Small language models make sense wherever an agent repeatedly performs the same bounded job. Peter Belcak and colleagues lay out the case for mixing small specialists and larger models in an agent. PAW adds a way to build those specialists from the application's own rules. The GitHub issue triage tutorial shows how three neural functions and one routing rule fit together.
What happens when an agent can build its own skills?
Imagine an agent that repeatedly sees the same question in different forms. It writes down the recurring job, collects examples, generates a specialist, and checks its answers. Once the specialist passes its tests, the agent installs the program. On the next request, it calls the function it built. If its duties change, it revises the specification and tests a replacement against the old and new cases.
Consider what that means for two people using the same assistant. A researcher wants to see a collaborator's draft before tomorrow's meeting. A manager wants to hear about a delayed shipment before the afternoon pickup. Each person can describe what deserves their attention, try it on their own messages, and keep the resulting model on their device.
Or imagine buying a cleaning robot. You photograph your rooms, point out the cables to avoid, and tell it which rooms to leave alone while the baby sleeps. A future compiler could use that description, the robot's sensors, and its available memory to build a model for your home. Change the furniture and you give the compiler new information. Your neighbor's robot runs different weights.
PAW starts with text specifications and executable neural functions. Our NeuralOS research asks a related question about software interfaces. Its model generates the next screen in response to a click or keystroke. Together these projects point toward applications whose behavior developers can specify through language and demonstrations.
An ecosystem of AI-generated neural software
Software developers install packages because someone else has already solved a problem they have. A neural program can travel the same way. Download the file, load it in the matching interpreter, and give it an input. A coding agent can try an existing program, or compile one for an application with a different vocabulary.
Three deployed applications use Compile by Training. Avatar Director translates human instructions into an action language for a 3D character. The English–Claudish translator uses two separately trained programs: one writes in the distinctive style of Claude Code, and the other rewrites that style in plain English. The Ask widget on my website runs a multi-site assistant. On the Waterloo AI course site, a question about an assignment can draw on both the course page and the relevant Piazza discussion. The EMNLP demonstration paper follows that question through the functions that draft and select the answer.
The Program Hub listed 6,179 public programs on November 27, 2026. Here are three you can run on new inputs:
- Line Break Remover repaired a line break between “the” and “new” in a pasted paragraph, returning We shipped the new release today.
- Japanese French Translator turned
Say 'thank you' in French.
into French | Merci. - Deadline Request Classifier returned URGENT for
Please send your poster revisions by 4 pm today.
Its specification defines urgency as a request to act by an explicit deadline today.
Build your own specialized model
Pick a function your application calls repeatedly. Write down one real input, the result you want, and what would change that result. Give the specification to the PAW Playground. Download the generated program and run it on a request you left out of the specification. Your application now has a function it can keep, inspect, and call again.
To work in Python, install the PAW SDK. To give a coding agent the PAW skill, run:
npx skills add programasweights/skills
Then ask your agent: Find a recurring task in my application that requires language understanding. Use Program-as-Weights to generate, test, and integrate a small local model for that task.
Every application could have its own models. Every device could have its own models. Agents could build up libraries of capabilities as they work. The Program-as-Weights research is our first step toward that future.
Questions about small language models for agents
Why use small language models in an AI agent?
A recurring task such as selecting a command or reading a build log has a specific input and output. A specialist for that task can run on the machine that holds the data. The agent can call a generalist when it needs broader reasoning.
Can a large language model directly generate another model's weights?
Yes. PAW's trained compiler generates task-specific adapter weights from a description in natural language. The adapter specializes a shared base model.
How does direct weight generation differ from fine-tuning?
Direct generation computes the adapter in a forward pass of a trained compiler. Fine-tuning updates weights over training examples for the task. PAW supports both compilation methods.
Can an AI agent create and install its own specialized models?
An agent can use the SDK to compile a specification, test the resulting program, save it, and load it as a function. The skill-building loop puts those operations together.


