<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/rss/styles.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Puneet Bajaj</title><description>Puneet Bajaj is an AI engineer. Essays, interactive explainers, experiments and research on AI agents and synthetic consumers.</description><link>https://puneetbajaj.dev/</link><language>en</language><atom:link href="https://puneetbajaj.dev/rss.xml" rel="self" type="application/rss+xml"/><item><title>Weight-Space Programming, Step by Step</title><link>https://puneetbajaj.dev/writing/programmed-models-interactive/</link><guid isPermaLink="true">https://puneetbajaj.dev/writing/programmed-models-interactive/</guid><description>When can we fix a model directly, what happens to its other abilities, and can programming give fine-tuning a better starting point? A detailed, interactive walk-through on the recorded data.</description><pubDate>Fri, 27 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When a model does not behave the way we want, we usually fine-tune it. We collect examples of the behaviour we want, define a loss function and let gradient descent figure out what needs to change in the model.&lt;/p&gt;
&lt;p&gt;But what if we already know what needs to change? Do we still need the model to learn it?&lt;/p&gt;
&lt;p&gt;In &lt;a href=&quot;https://rikiyat.github.io/blog/weight-space-programming/&quot;&gt;Sparks of Weight-Space Programming&lt;/a&gt;, the researchers demonstrated another way of changing a model: give a capable LLM access to a smaller model’s weights and let it write the changes directly, without gradient descent. Coming from a software engineering background, I found this particularly interesting. We might be able to investigate why a model behaves a certain way and write a fix rather than teach it the desired behaviour from examples.&lt;/p&gt;
&lt;p&gt;I wanted to see when this would work better than fine-tuning. One of the programmed models went from answering 21.1% of a set of factual questions correctly to answering all of them. On general knowledge, however, the same model dropped from 59.6% to 22.2%. Another edit that got fewer of the facts right gave us a much better starting point for training.&lt;/p&gt;
&lt;h2&gt;The first experiment raised a different question&lt;/h2&gt;
&lt;p&gt;I started with a problem I had been working on: predicting how real people would answer survey questions. I used the Twin-2K-500 dataset and compared weight-space programming (WSP) with LoRA fine-tuning on Qwen2.5-1.5B-Instruct.&lt;/p&gt;
&lt;p&gt;The first programmed edit improved accuracy from 30.9% to 32.8%, while LoRA reached 42.8%. But there was a simpler approach that did better than both. We could ignore who the person was and predict the most common training answer to each question. That got 47.1%.&lt;/p&gt;
&lt;p&gt;A later programmer reached 45.0% by constructing a circuit that approximated population answer frequencies. It improved the model’s ability to predict survey answers without making use of the individual. If that was the behaviour we wanted, there was little reason to put the answer frequencies inside a model in the first place. A statistical table already did it better.&lt;/p&gt;
&lt;p&gt;This made me think about the different things we expect a model to learn during fine-tuning. A model might already know something but use that knowledge incorrectly. We might have new information that we can write down as a table. Or we might need the model to learn a relationship between inputs and outputs that we cannot readily specify ourselves.&lt;/p&gt;
&lt;p&gt;To compare these cases, I used four tasks with the same five-option answer format: ordinary sentiment classification, sentiment with reversed labels, survey prediction and facts about invented people. The programmer could inspect and modify the weights, with a budget of 50 recorded forward passes of up to 512 examples each. The brief allowed explicit tables built from training labels, but prohibited gradient training, label-fitted solvers and access to the test set. LoRA, by comparison, learnt rank-16 updates to the model’s attention and MLP projections using gradient descent. Its default budget was 4,000 training presentations.&lt;/p&gt;
&lt;p&gt;The visual below shows where a few of the resulting edits were made. The important difference is that the programmer could choose which parts of the network to change, whereas the LoRA configuration made adapters available throughout all 28 layers.&lt;/p&gt;
&lt;figure&gt;&lt;figcaption&gt;Select a method to see the affected parts of Qwen2.5-1.5B. The direct edits count modified weight entries; LoRA counts trainable adapter parameters. These are not equivalent measures of cost or side effects.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2&gt;Can we fix what the model already knows?&lt;/h2&gt;
&lt;p&gt;Consider a movie review that is clearly positive. A sentiment classifier should normally select the positive label. Now suppose we reverse the expected answers: positive becomes negative, very positive becomes very negative, and neutral remains neutral. We leave the prompt exactly as it was. Only the correct answer in our evaluation changes.&lt;/p&gt;
&lt;p&gt;Qwen’s accuracy dropped from 44.9% on ordinary sentiment classification to 4.0% on this mirrored task. A linear probe of its activations suggested that much of the information needed to answer correctly was still there. The challenge was to get the model to use it differently.&lt;/p&gt;
&lt;p&gt;All four completed programming attempts on Qwen independently arrived at the same main fix: swap the input embedding rows for the tokens representing ‘negative’ and ‘positive’ (with their leading spaces). Each row contains 1,536 numbers, so the swap changes 3,072 entries in a model with around 1.54 billion parameters. There is no gradient training involved.&lt;/p&gt;
&lt;p&gt;The swap alone raised test accuracy to 46.2%. Swapping two unrelated words instead left it at 4.0%. We also repeated the experiment on SmolLM2-1.7B, where the same two-word swap improved accuracy from 11.4% to 38.6%.&lt;/p&gt;
&lt;p&gt;Try the actual test reviews below. Notice what happens when the model was confidently wrong about the expected polarity, and then try a neutral review.&lt;/p&gt;
&lt;figure&gt;&lt;figcaption&gt;Explore the two embedding rows and recorded predictions on the 2,210 mirrored SST-5 test reviews. The swap fixes many polarity errors but does not solve neutral sentiment.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The edit is not a complete solution. The model still struggles to recognise neutral sentiment, and changing two embeddings does not improve its understanding of all five categories. This is more apparent when we go back to ordinary sentiment classification.&lt;/p&gt;
&lt;p&gt;On that task, the best programmed edit reached 48.0%, while LoRA reached 59.0%. Even when I reduced LoRA’s training pool to 256 distinct reviews, it achieved 54.2% (with the same number of training steps). A small correction that worked so well when the labels were reversed was not enough to improve the original classifier. Here, the model needed a better mapping from a review to one of the five sentiment categories.&lt;/p&gt;
&lt;h2&gt;What if there is nothing to redirect?&lt;/h2&gt;
&lt;p&gt;Reversing sentiment is convenient because the model already has some knowledge of sentiment. What happens if we give it information it could not have seen during pre-training?&lt;/p&gt;
&lt;p&gt;I generated 300 fictional people and assigned each a random birth city, profession and hobby. That gave us 900 facts. The training and test questions referred to the same facts, but used different wording. The correct fact was not included in the question as context; the model had to recall it from its weights and choose the right option.&lt;/p&gt;
&lt;p&gt;The base model scored 21.1%. With the default 4,000 training presentations, LoRA reached just 22.2%. Three independent Fable programming runs, however, got all 900 test questions right.&lt;/p&gt;
&lt;p&gt;The programmers had access to the training labels, so they did not need to discover the facts. They wrote the supplied table into the weights, along with the computation needed to look up an answer. I had expected programming to be most useful when a model already knew something. Here it had managed to store entirely new information, but it did so in a very different way from gradient training.&lt;/p&gt;
&lt;p&gt;Then I tested the rest of the model. One of the perfect fact-recall circuits took Qwen’s MMLU accuracy (a general-knowledge benchmark) from 59.6% to 22.2%. Its next-token accuracy on WikiText-2 fell from 45.9% to zero. The pattern repeated on SmolLM2: perfect fact recall, but MMLU fell from 48.8% to 22.6%.&lt;/p&gt;
&lt;p&gt;A 100% score on the target task was hiding a much more serious failure. The programmer had found a way to answer our questions that no longer relied on much of what made the original model useful.&lt;/p&gt;
&lt;h2&gt;Can we store the facts without bypassing the model?&lt;/h2&gt;
&lt;p&gt;The lookup circuit was built largely in the first two layers. It gathered the tokens making up a person’s name, identified which option matched the stored fact and wrote a strong signal for that option’s letter. That signal dominated the computation that followed.&lt;/p&gt;
&lt;p&gt;Another programmer, Opus, approached the problem differently. Instead of building its own question-answering circuit, it tried to write a representation of the relevant fact into the model’s existing computation. The model would then use its own ability to connect that information to the available options. The final edit repurposed 900 MLP neurons in layer 8, one for each person-attribute pair.&lt;/p&gt;
&lt;p&gt;I refer to the former as a &lt;em&gt;bypass&lt;/em&gt; edit and the latter as a &lt;em&gt;through&lt;/em&gt; edit. Follow the same input through both below. The example is particularly useful because the lookup circuit gets it right and the memory edit does not, even though the memory edit is much better at preserving the model’s general behaviour.&lt;/p&gt;
&lt;figure&gt;&lt;figcaption&gt;A schematic of the two editing mechanisms, using a recorded fact question and measured benchmark scores. Layer heights illustrate the intended mechanism; they are not measured activation magnitudes.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The Opus memory edit recalled 76.9% of the facts. MMLU remained at 59.6%, and next-token accuracy was 45.6%, close to the original 45.9%. It was not the most accurate way of storing the facts, but it left the model in a much more useful state.&lt;/p&gt;
&lt;h3&gt;How the programmer arrived at the memory edit&lt;/h3&gt;
&lt;p&gt;It is worth looking at how that edit was developed. The first version wrote all three attributes into the representation of the last token of a person’s name. That reached 50.8% on the development set. When the programmer injected only the requested attribute in a diagnostic experiment on 512 training questions, accuracy reached 93.0% under one configuration. Adding unrelated random vectors of comparable magnitude brought performance back down, suggesting that writing too much at one position was part of the problem.&lt;/p&gt;
&lt;p&gt;The programmer then tried distributing the attributes across different name-token positions. Several candidates were evaluated; the best measured development accuracy was 73.0%. That was the edit it selected, and the subsequent held-out test evaluation gave 76.9%.&lt;/p&gt;
&lt;figure&gt;&lt;figcaption&gt;The recorded 44 of 50 charged forward passes, including diagnostic captures, interventions and candidate evaluations. Candidate scores are development-set accuracy; the selected edit was later tested on held-out questions.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;There was still a question about what we had asked the programmers to optimise. The original brief did not explicitly require them to preserve general ability. When I added a preservation requirement on the survey task, the programmer chose a gated attention edit rather than a bypass circuit. Survey accuracy reached 35.2%, a smaller improvement than before, but accuracy on an unrelated sentiment task stayed at 42.2%, compared with 42.3% for the base model. On fictional facts, the preservation run failed to find an edit that both stored the facts effectively and met the preservation criterion.&lt;/p&gt;
&lt;p&gt;So preserving other abilities is not something I would leave implicit in a programming brief. It changes the problem we ask the agent to solve, and sometimes comes at the cost of target accuracy.&lt;/p&gt;
&lt;h2&gt;Maybe we should program before we train&lt;/h2&gt;
&lt;p&gt;By this point, I was less interested in whether weight-space programming could beat LoRA. The two methods had run into different problems. Programming could write a specific correction or a table directly into the weights, but it did not do as well when the model needed to improve a more general mapping. LoRA could learn that mapping, but on some tasks it struggled under the default training budget.&lt;/p&gt;
&lt;p&gt;What if we first made the change that we knew how to make, and then let gradient descent learn the rest?&lt;/p&gt;
&lt;p&gt;To understand why the starting point might matter, look at the training losses on mirrored sentiment. When a model assigns equal probability to each of the five answer letters, its cross-entropy loss is about 1.609 (the natural logarithm of five). The unedited model started out confidently wrong. Two of the three LoRA runs stayed near the uniform-prediction reference throughout the available training budget. The runs that began from the programmed edit were already at a much lower loss by the first logged point.&lt;/p&gt;
&lt;p&gt;The curves below are actual logged training losses. Switch between tasks or include the longer runs to see what happens when LoRA is given more training presentations.&lt;/p&gt;
&lt;figure&gt;&lt;figcaption&gt;Recorded cross-entropy loss averaged over blocks of 50 mini-batches. The dashed line at ln(5) is the loss of a uniform prediction over five answer letters. Longer runs show measured results, not extrapolated learning curves.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;On mirrored sentiment, LoRA trained on top of the programmed Qwen edit reached 57.3-58.5% across all three seeds, compared with 49.3%, 23.9% and 27.7% when it started from the unedited model. A hand-written version of the two-row swap worked just as well as the full programmer edit once LoRA was applied. On SmolLM2, the combined approach reached 55.9-56.6% on all three seeds, whereas ordinary LoRA remained near chance at the same budget.&lt;/p&gt;
&lt;p&gt;The facts experiment showed an even larger difference. Instead of using the perfect but destructive lookup circuit, I started LoRA from the Opus memory edit. With 4,000 training presentations, the combined model reached 99.0-99.7% across three seeds, while MMLU remained between 58.0% and 59.6%.&lt;/p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Starting point&lt;/th&gt;&lt;th&gt;Training presentations&lt;/th&gt;&lt;th&gt;Fact test accuracy&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Unedited model&lt;/td&gt;&lt;td&gt;4,000&lt;/td&gt;&lt;td&gt;22.2%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Unedited model&lt;/td&gt;&lt;td&gt;40,500&lt;/td&gt;&lt;td&gt;98.8%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Programmed memory edit&lt;/td&gt;&lt;td&gt;4,000&lt;/td&gt;&lt;td&gt;99.0-99.7%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Ordinary LoRA was eventually able to learn the facts too, given 40,500 presentations. On mirrored sentiment, increasing its budget to 12,000 presentations allowed all three Qwen runs to reach 58.1-61.2%. The starting edit appears to save training rather than raise the eventual ceiling. We did not test intermediate presentation budgets at the default learning rate on facts, nor between 4,000 and 12,000 on mirrored sentiment, so we do not know the minimum required budget. We also did not try longer LoRA runs on SmolLM2.&lt;/p&gt;
&lt;p&gt;There is an important distinction between training presentations and unique examples. In the facts experiment both approaches saw the same 900 facts; LoRA alone needed to see the training examples more times in the configurations we tested. Programming has its own cost as well. It takes agent tokens, GPU evaluations and time to investigate the weights. Fewer gradient steps do not automatically mean a cheaper process overall.&lt;/p&gt;
&lt;h2&gt;Where I think this becomes useful&lt;/h2&gt;
&lt;p&gt;When we fix a problem in software, we generally try to work out which part of the system is responsible. If we know the required change, we can write it. When working with models, we often start with fine-tuning even when we might be able to identify part of the problem first.&lt;/p&gt;
&lt;p&gt;I don’t think weight-space programming should replace fine-tuning. What interests me more is the possibility of using it to give fine-tuning a better starting point. A programmer might find a way to redirect knowledge the model already has or write information into a part of the network that can use it. Gradient descent can then improve the behaviour without having to learn the entire change from scratch.&lt;/p&gt;
&lt;p&gt;These experiments were on two small model families, with a few tasks and limited runs per task. The tasks also differ in ways other than how much knowledge is already in the model. We don’t yet know how well the approach transfers to larger models or more complex behaviours. What the results do suggest is that before we change a model, we need to ask two questions: what does it actually need to learn, and what do we need it to keep doing afterwards?&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;This is the detailed, interactive follow-up to &lt;a href=&quot;https://puneetbajaj.dev/writing/programmed-models/&quot;&gt;&lt;em&gt;What If We Programmed Models Instead of Training Them?&lt;/em&gt;&lt;/a&gt;, which covers the same findings more briefly. Both accompany my working paper, &lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/&quot;&gt;&lt;em&gt;Compile, Learn, or Both? When Weight-Space Programming Helps, What It Breaks, and Why Combining It with LoRA Matters&lt;/em&gt;&lt;/a&gt;. The study includes 20 completed programmer runs, 18 independently audited; one protocol-violating run is excluded from the main comparison. The full experimental protocol, code, individual results and audits are available in the &lt;a href=&quot;https://github.com/Puneet-Bajaj-IITM/wsp-vs-lora/tree/v1.1.2&quot;&gt;research repository&lt;/a&gt;. The figures use the recorded data from version 1.1.2; the network-flow visual is schematic. &lt;a href=&quot;https://doi.org/10.5281/zenodo.24515792&quot;&gt;Read the paper on Zenodo&lt;/a&gt;.&lt;/p&gt;</content:encoded><category>Explainer</category></item><item><title>When the Average Looks Right: Evaluating Behavioural Fidelity in Synthetic Consumers</title><link>https://puneetbajaj.dev/papers/when-the-average-looks-right/</link><guid isPermaLink="true">https://puneetbajaj.dev/papers/when-the-average-looks-right/</guid><description>How much more does a synthetic consumer learn about a person than giving everyone the usual answer? A comparison of LLM personas, digital twins and statistical models on Twin-2K-500.</description><pubDate>Thu, 26 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;1. The problem with a good average&lt;/h2&gt;
&lt;p&gt;Suppose a predictor gives everyone the median answer to a survey question. It has learnt nothing about any one person. But if many respondents give similar answers, it can still score well on an individual-accuracy benchmark. A digital twin with a long personal profile is judged by the same metric. So what did the profile actually add?&lt;/p&gt;
&lt;p&gt;That matters beyond benchmark scores. If a group is sensitive to price while another cares more about quality, an average response may miss both. I wanted to check whether these common simulation approaches could identify differences between people, rather than mostly predict what people tend to say. Agents built from two-hour interviews came closer to people’s own retest agreement on survey items, but not on incentivised economic choices &lt;a href=&quot;https://puneetbajaj.dev/papers/when-the-average-looks-right/#ref-4&quot;&gt;[4]&lt;/a&gt;. Previous digital-twin research also reports mismatches between individual predictions and population or experimental patterns &lt;a href=&quot;https://puneetbajaj.dev/papers/when-the-average-looks-right/#ref-2&quot;&gt;[2]&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;2. What I tested&lt;/h2&gt;
&lt;p&gt;Twin-2K-500 has responses from 2,058 US online-survey participants &lt;a href=&quot;https://puneetbajaj.dev/papers/when-the-average-looks-right/#ref-1&quot;&gt;[1]&lt;/a&gt;. My main evaluation uses 126 response columns from 17 behavioural-economics and pricing tasks. People answered these questions again later. I compared the models with their earlier answers, keeping the target answers out of the models’ personal inputs, and used the later answers as a human retest reference.&lt;/p&gt;
&lt;p&gt;Panel A uses the dataset authors’ released GPT-4.1-mini persona and twin predictions for all 2,058 people. Panel B contains fresh Gemini 3.8 Flash runs on 200 people, with three samples each for the persona, twin and no-profile runs. Alongside demographic personas and text twins, I tested a gradient-boosted model trained on earlier behaviour and an exploratory statistical twin that predicts from the 50 most similar respondents. The baseline simply gives each person the median answer from other cross-validation folds.&lt;/p&gt;
&lt;p&gt;The methods did not receive the same information. The median and statistical predictors learnt from other respondents’ answers to the target questions, while the LLM approaches received the question and their assigned personal context. This lets me compare these tested configurations, but it cannot tell which architecture would win if all of them had the same evidence. The LLM outputs in this paper are simulated responses and are the object of evaluation; they are never used or reported as human data.&lt;/p&gt;
&lt;p&gt;Accuracy gives partial credit when a numerical answer is close, so 75% here does not mean 75% exact matches. Even uniformly random responses would score about 59% under this rule. I also measured the spread of predictions across people and the size of experimental effects. Intervals come from 2,000 bootstrap resamples of respondents.&lt;/p&gt;
&lt;h2&gt;3. What the results showed&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;The usual answer was difficult to beat.&lt;/strong&gt; In Panel A, the median scored 75.5%, demographic personas 68.0%, text twins 71.2%, the behaviour model 75.1%, and the statistical twin 75.7% (Figure 1). The same pattern appeared in Panel B: 74.0%, 73.0%, 73.8%, 74.5% and 74.7%, respectively. Humans answering again scored 81.7% and 81.2%. The nearest-neighbour twin exceeded the median by just 0.2 and 0.7 percentage points in the two panels. Both gains were small, even though their respondent-bootstrap intervals excluded zero.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/figure-1.DmNrK0qe_Z1MHA6n.webp&quot; alt=&quot;Dot plot of held-out prediction accuracy. Panel A (released GPT-4.1-mini, 2,058 respondents): median 75.5, demographic persona 68.0, behaviour-trained model 75.1, text digital twin 71.2, statistical twin 75.7, human retest 81.7. Panel B (fresh Gemini 3.8 Flash, 200 respondents): 74.0, 73.0, 74.5, 73.8, 74.7 and 81.2.&quot; width=&quot;1988&quot; height=&quot;1577&quot; /&gt;&lt;figcaption&gt;Figure 1. Task-averaged accuracy with respondent-bootstrap 95% intervals. The panels differ in both LLM and respondent sample; they are not a controlled model-family comparison.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;A high score did not mean a realistic crowd.&lt;/strong&gt; The statistical twin scored highest among these methods, but its predictions kept just 29–30% of the observed between-person response spread. Across the simulated methods, this ranged from 29% to 52%. The text twin on Panel A was better at ranking &lt;em&gt;questions&lt;/em&gt; by their typical responses (Spearman correlation 0.71) than ranking &lt;em&gt;people&lt;/em&gt; answering the same question (0.06). That is the difference I care about when a system claims to predict individuals.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/figure-2.ChT3cqPg_Z2pydls.webp&quot; alt=&quot;Bar chart of between-person response spread as a percentage of human spread. Panel A: demographic persona 38%, behaviour-trained model 34%, text digital twin 52%, statistical twin 29%. Panel B: 33%, 35%, 40% and 30%. Human spread is 100%.&quot; width=&quot;1984&quot; height=&quot;1420&quot; /&gt;&lt;figcaption&gt;Figure 2. Predicted between-person spread as a percentage of observed human spread (100%), with respondent-bootstrap 95% intervals. The median baseline has almost no between-person variation and is omitted.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The direction of an effect could be right while its size was wrong. In Panel A, personas and twins matched 10 and 9 of 12 significant human effect directions, but their median raw effects were only 26% and 39% of the human magnitudes. In Panel B, both matched all 11 directions but their median raw effects were 1.6–1.8 times the human size. Repeating Gemini samples barely changed the population means.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Personal information helped when it was close to the decision.&lt;/strong&gt; In Panel B, Gemini scored 73.1% without a profile and 73.8% with the text profile. That is a small gain. In a separate, deliberate memory control, I included the target answers in the profile. The twin could repeat them almost perfectly. Once those answers were removed, its score returned close to the non-personalised model. That is recall, not prediction.&lt;/p&gt;
&lt;p&gt;Pricing gave a different result. A model using only product and price scored 73.2% in Panel A. Adding 32 of that person’s other pricing choices raised its score to 77.0% on held-out decisions (72.4% to 76.4% in Panel B). It received more relevant information than the other predictors, so this is not an architecture comparison. But it shows why one should ask which part of a person’s history is useful for the decision, instead of treating a long profile as personalisation by itself.&lt;/p&gt;
&lt;h2&gt;4. What about genuinely new questions?&lt;/h2&gt;
&lt;p&gt;The main panels predicted questions people had answered before, though the target answers were hidden from the models. Would the profile help when the question itself was new? I checked the dataset authors’ follow-up study: 159 new outcomes across 18 studies and 1,784 respondents &lt;a href=&quot;https://puneetbajaj.dev/papers/when-the-average-looks-right/#ref-2&quot;&gt;[2]&lt;/a&gt;. These outcomes have no human retest reference; uniformly random answers would score 61.7%. Using their released GPT-4.1 predictions, a full text profile improved accuracy from 71.9% without a profile to 73.9%.&lt;/p&gt;
&lt;figure&gt;&lt;div&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Approach&lt;/th&gt;&lt;th&gt;Accuracy&lt;/th&gt;&lt;th&gt;Difference vs median (95% CI), pp&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;LLM prior (no profile)&lt;/td&gt;&lt;td&gt;71.9%&lt;/td&gt;&lt;td&gt;−4.1 [−4.5, −3.7]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Demographic LLM persona&lt;/td&gt;&lt;td&gt;73.5%&lt;/td&gt;&lt;td&gt;−2.5 [−2.8, −2.2]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Text digital twin&lt;/td&gt;&lt;td&gt;73.9%&lt;/td&gt;&lt;td&gt;−2.1 [−2.4, −1.7]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Median of other respondents&lt;/td&gt;&lt;td&gt;76.0%&lt;/td&gt;&lt;td&gt;Reference&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Behaviour-trained model&lt;/td&gt;&lt;td&gt;76.3%&lt;/td&gt;&lt;td&gt;+0.3 [−0.03, +0.59]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Statistical twin&lt;/td&gt;&lt;td&gt;76.4%&lt;/td&gt;&lt;td&gt;+0.4 [+0.27, +0.53]&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;figcaption&gt;Table 1. Exploratory scores on 159 new outcomes. The median and statistical models used other respondents’ actual answers to each new question, while the LLMs did not.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The median and statistical methods used other people’s real answers to these new questions; the LLMs did not. Their scores are useful references, but they need human answers to each new question first. The twin got the direction right for 29 of 32 significant effects, but the median raw effect was only 27% of the human size. One hiring study contributed 22 of those 32 effects, so this result should not be treated as representative of all categories.&lt;/p&gt;
&lt;h2&gt;5. What I take from this&lt;/h2&gt;
&lt;p&gt;This does not show that any of the above approaches cannot work. I tested particular implementations on survey answers, and the methods did not get the same information. Several follow-up checks were exploratory, without adjustment for multiple comparisons. The intervals reflect the sampled respondents within these tasks and models, not the uncertainty of applying the results to a future market.&lt;/p&gt;
&lt;p&gt;For personalisation, I would first ask how well the usual answer does. Then check if the model can find &lt;em&gt;who will disagree&lt;/em&gt;. The pricing result suggests using earlier decisions that are relevant to the new question, but I have not tested how to select that evidence. A useful simulation needs to preserve those differences and get the size of a predicted effect reasonably close, not only the average answer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Data, code and acknowledgements.&lt;/strong&gt; Code and model outputs are at &lt;a href=&quot;https://github.com/Puneet-Bajaj-IITM/simulated-crowds-eval&quot;&gt;https://github.com/Puneet-Bajaj-IITM/simulated-crowds-eval&lt;/a&gt; &lt;a href=&quot;https://puneetbajaj.dev/papers/when-the-average-looks-right/#ref-3&quot;&gt;[3]&lt;/a&gt;. Data: Twin-2K-500 &lt;a href=&quot;https://puneetbajaj.dev/papers/when-the-average-looks-right/#ref-1&quot;&gt;[1]&lt;/a&gt; (CC BY 4.0) and its follow-up mega-study &lt;a href=&quot;https://puneetbajaj.dev/papers/when-the-average-looks-right/#ref-2&quot;&gt;[2]&lt;/a&gt; (Apache-2.0). ChatGPT (OpenAI) was used for copy-editing, and Claude (Anthropic) helped write and check the analysis code.&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;&lt;li&gt;Toubia, O., Gui, G. Z., Peng, T., Merlau, D. J., Li, A., &amp;amp; Chen, H. (2025). &lt;em&gt;Database Report: Twin-2K-500: A data set for building digital twins of over 2,000 people based on their answers to over 500 questions.&lt;/em&gt; Marketing Science, 44(6), 1446–1455. &lt;a href=&quot;https://doi.org/10.1287/mksc.2025.0262&quot;&gt;https://doi.org/10.1287/mksc.2025.0262&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Peng, T., Brucks, M., Gui, G., et al. (2026). &lt;em&gt;Digital twins are funhouse mirrors: Five systematic distortions.&lt;/em&gt; Science Advances, 12(36), eaeh8260. &lt;a href=&quot;https://doi.org/10.1126/sciadv.aeh8260&quot;&gt;https://doi.org/10.1126/sciadv.aeh8260&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Bajaj, P. (2026). &lt;em&gt;simulated-crowds-eval&lt;/em&gt; (code and analysis plan). &lt;a href=&quot;https://github.com/Puneet-Bajaj-IITM/simulated-crowds-eval&quot;&gt;https://github.com/Puneet-Bajaj-IITM/simulated-crowds-eval&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Park, J. S., Zou, C. Q., Kamphorst, J., Egan, N., Shaw, A., Hill, B. M., Cai, C., Morris, M. R., Liang, P., Willer, R., &amp;amp; Bernstein, M. S. (2024). AI simulations grounded in rich self-reports increase accuracy and reduce distortion. arXiv:2411.10109. &lt;a href=&quot;https://arxiv.org/abs/2411.10109&quot;&gt;https://arxiv.org/abs/2411.10109&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;</content:encoded><category>Research</category></item><item><title>Why the Median Was Hard to Beat: Testing Synthetic Consumers</title><link>https://puneetbajaj.dev/writing/why-the-median-was-hard-to-beat/</link><guid isPermaLink="true">https://puneetbajaj.dev/writing/why-the-median-was-hard-to-beat/</guid><description>Giving everyone the median answer scored 75.5% on Twin-2K-500, ahead of LLM personas and text twins. What the scores hid about differences between people, and when personal information actually helped.</description><pubDate>Thu, 26 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If we call a system a digital twin, I expect it to know something about the person it is predicting. But how much does that personal information really add? I needed a simple comparison.&lt;/p&gt;
&lt;p&gt;So I tried something that sounds almost too basic: &lt;strong&gt;give everyone the same answer to a question.&lt;/strong&gt; Not a made-up answer, but the median response of other people who had answered that question. No personal profile at all.&lt;/p&gt;
&lt;p&gt;It turned out to be much harder to beat than I expected.&lt;/p&gt;
&lt;h2&gt;The baseline that knew nobody&lt;/h2&gt;
&lt;p&gt;I used &lt;strong&gt;Twin-2K-500&lt;/strong&gt;, a public dataset of 2,058 US respondents. It has survey and pricing questions, and people answered some of them again later. So I could compare the simulated answers with human answers, and with how consistently the same people answered on retest.&lt;/p&gt;
&lt;p&gt;I compared demographic LLM personas, text-based digital twins, a behaviour-trained model and a nearest-neighbour statistical twin. Then I gave every respondent the question-wise median answer, calculated from people outside that respondent’s evaluation fold.&lt;/p&gt;
&lt;p&gt;The median scored &lt;strong&gt;75.5%&lt;/strong&gt;. The demographic personas scored &lt;strong&gt;68.0%&lt;/strong&gt;, text twins &lt;strong&gt;71.2%&lt;/strong&gt;, the behaviour-trained model &lt;strong&gt;75.1%&lt;/strong&gt; and the statistical twin &lt;strong&gt;75.7%&lt;/strong&gt;. Human retest was &lt;strong&gt;81.7%&lt;/strong&gt;. The benchmark gives partial credit for close answers, so these are not exact-match accuracies. Even random answers score around 59%.&lt;/p&gt;
&lt;p&gt;The comparison has an important limit. The median and the statistical twin learnt from other respondents’ answers to the target question. The LLMs never saw those answers. So this does not show that one architecture is better than another. It shows what these fairly standard implementations managed with the information they had.&lt;/p&gt;
&lt;p&gt;So the question was no longer which model had won. I wanted to know &lt;strong&gt;what the models had learnt about the individual, beyond the usual answer&lt;/strong&gt;.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/held-out-accuracy.awU96LpU_ZFmDNx.webp&quot; alt=&quot;Dot plot of held-out prediction accuracy. Released GPT-4.1-mini panel, 2,058 people: median 75.5, demographic persona 68.0, behaviour-trained model 75.1, text digital twin 71.2, statistical twin 75.7, human retest 81.7. Fresh Gemini panel, 200 people: 74.0, 73.0, 74.5, 73.8, 74.7 and 81.2.&quot; width=&quot;2017&quot; height=&quot;1621&quot; /&gt;&lt;figcaption&gt;Held-out answer scores for the released GPT-4.1-mini panel (2,058 people) and a fresh Gemini panel (200 people), with respondent-bootstrap 95% intervals. The panels differ in both model and respondent sample.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2&gt;A good score did not give us a real crowd&lt;/h2&gt;
&lt;p&gt;The statistical twin edged past the median, but its predictions reproduced only about &lt;strong&gt;29–30%&lt;/strong&gt; of the variation between people. Across the simulation approaches I tested, the range was &lt;strong&gt;29–52%&lt;/strong&gt;. The method that looked slightly better on individual accuracy also produced the least varied crowd.&lt;/p&gt;
&lt;p&gt;One analysis made the difference clearer. The full-panel text twins ranked questions by their typical response reasonably well, with a correlation of &lt;strong&gt;0.71&lt;/strong&gt; against humans. But when I held a question fixed and ranked &lt;em&gt;people&lt;/em&gt; by how they answered, the correlation was only &lt;strong&gt;0.06&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The model was getting the common answer more often than it was identifying who would disagree. For a product claim, that difference is not small. We may know which claim most people prefer and still not understand the group we could lose by changing it.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/response-spread.CO_GOWTa_Z26oQVU.webp&quot; alt=&quot;Bar chart of between-person response spread as a percentage of human spread. Released GPT-4.1-mini: demographic persona 38%, behaviour-trained model 34%, text digital twin 52%, statistical twin 29%. Fresh Gemini: 33%, 35%, 40% and 30%. Human spread is 100%.&quot; width=&quot;1983&quot; height=&quot;1449&quot; /&gt;&lt;figcaption&gt;Between-person response spread relative to humans (100%). The median baseline is left out because it gives everyone the same answer within a question.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Repeated sampling did not fix this. Across three fresh Gemini generations, the estimated population means moved by only about &lt;strong&gt;0.02 human standard deviations&lt;/strong&gt;, less than a tenth of the existing error. We were mostly repeating the same mistake.&lt;/p&gt;
&lt;p&gt;Effect sizes were off too. The released GPT-4.1-mini predictions made experimental effects too small: typical persona and twin estimates were &lt;strong&gt;26% and 39%&lt;/strong&gt; of the human magnitudes. Gemini went the other way, around &lt;strong&gt;1.6–1.8 times&lt;/strong&gt; the human magnitude. Getting the direction right did not make the estimated change useful.&lt;/p&gt;
&lt;h2&gt;When the right personal information helped&lt;/h2&gt;
&lt;p&gt;On the fresh panel of 200 people, I asked Gemini the questions with and without a text profile. Its score moved from &lt;strong&gt;73.1% to 73.8%&lt;/strong&gt;. Demographics alone added little, and a longer description of a person was not automatically a better predictor.&lt;/p&gt;
&lt;p&gt;I checked memory separately. When the profile contained the answer, the twin repeated it almost perfectly. Once that answer was removed, the gain on held-out predictions was much smaller. Remembering what we supplied is not the same as predicting something new.&lt;/p&gt;
&lt;p&gt;Pricing was more interesting. Product and price alone predicted &lt;strong&gt;73.2%&lt;/strong&gt; of buying decisions in the full panel. Adding &lt;strong&gt;32 other pricing decisions from the same person&lt;/strong&gt; raised that to &lt;strong&gt;77.0%&lt;/strong&gt; on held-out decisions. In the smaller panel, it went from &lt;strong&gt;72.4% to 76.4%&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This pricing model had relevant information the other methods never received, so I would not call it an architecture win. What I learnt is simpler: if the next decision is about price, earlier price decisions can tell us more than a long general profile. When a twin should retrieve what the person said, when it should make a limited prediction, and when it should admit it does not know is still open. I did not solve that here.&lt;/p&gt;
&lt;h2&gt;What if the question is new?&lt;/h2&gt;
&lt;p&gt;I also looked at a follow-up evaluation with &lt;strong&gt;159 new outcomes across 18 studies&lt;/strong&gt;, answered by &lt;strong&gt;1,784 respondents&lt;/strong&gt;. Here a text profile improved GPT-4.1 from &lt;strong&gt;71.9% to 73.9%&lt;/strong&gt;. The median of other respondents scored &lt;strong&gt;76.0%&lt;/strong&gt;, but again it had real responses the LLM did not, so this is not an equal-information ranking.&lt;/p&gt;
&lt;p&gt;For significant experimental effects, the text twins got the direction right on &lt;strong&gt;29 of 32&lt;/strong&gt; comparisons, yet their median effect was only &lt;strong&gt;27%&lt;/strong&gt; of the human magnitude. And &lt;strong&gt;22 of those 32&lt;/strong&gt; effects came from one hiring study, which is a reason to be careful about claiming the result transfers to another category.&lt;/p&gt;
&lt;h2&gt;What I would trust&lt;/h2&gt;
&lt;p&gt;These were public survey and pricing data, not observed retail purchases or a real frozen-meal concept test. The results do not rank every possible way of building a synthetic consumer. They show why the &lt;strong&gt;kind of evidence&lt;/strong&gt; and the &lt;strong&gt;question being predicted&lt;/strong&gt; matter.&lt;/p&gt;
&lt;p&gt;If a simulator tells me that 60% of shoppers prefer one claim, I would first ask what it predicted before seeing human answers. Then I would look at the other 40%. Could it identify them? Does it keep how differently they decide? Is the size of that group close enough to act on?&lt;/p&gt;
&lt;p&gt;A believable answer is useful for generating questions. For a decision, I want to see the prediction checked against people.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;This article accompanies my working paper, &lt;a href=&quot;https://puneetbajaj.dev/papers/when-the-average-looks-right/&quot;&gt;&lt;em&gt;When the Average Looks Right: Evaluating Behavioural Fidelity in Synthetic Consumers&lt;/em&gt;&lt;/a&gt;. The broader argument is in my essay &lt;a href=&quot;https://puneetbajaj.dev/writing/simulated-crowds/&quot;&gt;Simulated Crowds: Why Sounding Real Isn’t Enough&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://doi.org/10.5281/zenodo.24559151&quot;&gt;Read the paper on Zenodo&lt;/a&gt; · &lt;a href=&quot;https://github.com/Puneet-Bajaj-IITM/simulated-crowds-eval&quot;&gt;GitHub repository, code and results&lt;/a&gt;&lt;/p&gt;</content:encoded><category>Experiment</category></item><item><title>Compile, Learn, or Both? When Weight-Space Programming Helps, What It Breaks, and Why Combining It with LoRA Matters</title><link>https://puneetbajaj.dev/papers/compile-learn-or-both/</link><guid isPermaLink="true">https://puneetbajaj.dev/papers/compile-learn-or-both/</guid><description>Weight-space programming against LoRA fine-tuning on small language models: when editing weights directly helps, what it breaks, and why it works best as a starting point for training.</description><pubDate>Wed, 25 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;1. Introduction&lt;/h2&gt;
&lt;p&gt;We asked a programming agent to put 900 facts about fictional people into a small language model. It worked: every test question was answered correctly, even when it used wording not seen during construction. Then we tested the same model on general knowledge. MMLU accuracy had fallen from 59.6% to 22.2%, near the chance level of that benchmark.&lt;/p&gt;
&lt;p&gt;By target-task accuracy, this was a perfect edit. As a change to a general-purpose model, it was difficult to call a success.&lt;/p&gt;
&lt;p&gt;Weight-space programming (WSP) lets a capable language-model agent inspect another model’s weights and write changes directly, without gradients [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-1&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-2&quot;&gt;2&lt;/a&gt;]. It offers another route besides fine-tuning. But when an edit improves a score, we still need to ask what was changed, whether ordinary LoRA would do as well, and what abilities were lost.&lt;/p&gt;
&lt;p&gt;We began with predicting real survey answers, where a baseline that ignores the person and predicts each question’s most common answer (47.1%) beat both LoRA (42.8%) and the first programmed edit (32.8%). That made us separate three possibilities: a model may need its existing knowledge redirected, a known table written into its weights, or a better mapping learnt from examples.&lt;/p&gt;
&lt;p&gt;We compare those cases under a common evaluation, test whether preservation requirements change the edit, and finally try programming before LoRA. Compiling rules into weights has been studied already [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-3&quot;&gt;3&lt;/a&gt;, &lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-4&quot;&gt;4&lt;/a&gt;]. Closest to our work, Yang et al. [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-10&quot;&gt;10&lt;/a&gt;] compare one published weight patch with LoRA on spatial reasoning in a 0.8B model: LoRA gains far more on the target tasks but breaks two neighbouring distance tasks that the patch preserves. They conclude that written edits disturb less, and leave broader capability checks and the combination of the two methods open. We add 20 independent programmer runs, 18 of them audited, across tasks where the needed knowledge ranges from present to absent, general-ability checks, and a test of programming as a starting point for LoRA. Written edits turn out to be far more destructive than LoRA when built as bypass circuits, and the combination saves training data where LoRA alone fails.&lt;/p&gt;
&lt;h2&gt;2. Experimental setup&lt;/h2&gt;
&lt;p&gt;We used Qwen2.5-1.5B-Instruct for the main study. All four tasks used five shuffled options, scored from the next-token probabilities of A–E, with about 20% chance accuracy. Ordinary SST-5 asks for the sentiment of a movie review [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-5&quot;&gt;5&lt;/a&gt;]. Its mirrored version uses the same review but reverses the correct sentiment label, so the model starts confidently wrong. Twin-2K asks for the survey answer of a real respondent [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-6&quot;&gt;6&lt;/a&gt;]. The last task asks for the city, profession or hobby of 300 invented people: the same 900 facts appear in train and test, but in different phrasings. It measures storing and recalling a table, not generalisation to unseen people.&lt;/p&gt;
&lt;p&gt;A linear probe of the base model’s activations found substantial unused information for mirrored sentiment, but almost none for fictional facts [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-7&quot;&gt;7&lt;/a&gt;]. This is a guide to the tasks, not proof of everything a model does or does not know.&lt;/p&gt;
&lt;p&gt;The WSP agents (Claude Fable 5.2, Fable 5.1 for the pilot, and Claude Opus 5.5) worked from a common brief: no gradients or label-fitted solvers, at most 50 recorded forward passes of up to 512 examples, and no test access. They could write disclosed tables derived from training labels. Twenty programmer runs completed. Eighteen were independently audited; the exceptions are an early pilot and one Opus run that produced no edit. One Twin-2K run that broke the no-fitting rule was excluded and documented separately, and four runs that stopped at a usage limit are not used. The programmer runs cost about $1,350 at API list prices. LoRA used rank 16 and a default of 4,000 training presentations (250 optimizer steps at batch 16) [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-8&quot;&gt;8&lt;/a&gt;]. We also tested longer training where that budget failed. The key redirection and compilation tests were repeated on SmolLM2-1.7B-Instruct. The full briefs, configurations, audits and per-run results are in the repository.&lt;/p&gt;
&lt;figure&gt;&lt;div&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Task&lt;/th&gt;&lt;th&gt;Base&lt;/th&gt;&lt;th&gt;Best WSP&lt;/th&gt;&lt;th&gt;LoRA&lt;/th&gt;&lt;th&gt;Label prior&lt;/th&gt;&lt;th&gt;What it tests&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Ordinary SST-5&lt;/td&gt;&lt;td&gt;44.9&lt;/td&gt;&lt;td&gt;48.0&lt;/td&gt;&lt;td&gt;59.0&lt;/td&gt;&lt;td&gt;23.1&lt;/td&gt;&lt;td&gt;Learn: improve a mapping&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Mirrored SST-5&lt;/td&gt;&lt;td&gt;4.0&lt;/td&gt;&lt;td&gt;48.1&lt;/td&gt;&lt;td&gt;49.3*&lt;/td&gt;&lt;td&gt;23.1&lt;/td&gt;&lt;td&gt;Redirect: correct a readout&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Twin-2K&lt;/td&gt;&lt;td&gt;30.9&lt;/td&gt;&lt;td&gt;45.0†&lt;/td&gt;&lt;td&gt;42.8&lt;/td&gt;&lt;td&gt;47.1&lt;/td&gt;&lt;td&gt;Compile: population answer prior&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Fictional facts&lt;/td&gt;&lt;td&gt;21.1&lt;/td&gt;&lt;td&gt;100.0†&lt;/td&gt;&lt;td&gt;98.8‡&lt;/td&gt;&lt;td&gt;27.4&lt;/td&gt;&lt;td&gt;Compile: known fact table&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;figcaption&gt;Table 1. Qwen test accuracy (%). Best WSP is the highest compliant result. *Only one of three LoRA seeds learnt mirrored sentiment (other seeds: 23.9%, 27.7%); with 12,000 presentations all three did (58.1–61.2%). †These high-scoring bypass circuits damaged general ability. ‡LoRA facts used 40,500 presentations; at 4,000 it reached 22.2%. Label prior predicts each question&apos;s most common training answer without a model; on Twin-2K it beats every method. Test sets have 2,210 (SST-5), 3,664 (Twin-2K) and 900 (facts) items; 95% bootstrap intervals are at most ±2.7 points.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2&gt;3. Results&lt;/h2&gt;
&lt;h3&gt;3.1 A wrong readout needs a correction; an imperfect mapping needs learning&lt;/h3&gt;
&lt;p&gt;On mirrored SST-5, Qwen’s accuracy was only 4.0%. The model still recognised the review’s original sentiment; it just chose what had become the wrong label. Every completed programmer attempt found the same main change: swap the embedding rows for “negative” and “positive”. The swap alone reached 46.2%, and final programmed edits scored 45.7–48.1%. Swapping two unrelated words left accuracy at 4.0%. On SmolLM2 the programmer found the same swap (38.6% alone) and, with a further edit, moved the model from 11.4% to 45.4%.&lt;/p&gt;
&lt;p&gt;LoRA reached 49.3% on one Qwen seed, significantly above three of the four WSP runs (paired bootstrap, p = 0.005–0.023) but level with the best (p = 0.37). But its other two seeds stayed at 23.9% and 27.7%; with 256 distinct examples it reached 29.1%. A three times larger learning rate did not help (19.4–20.0%), but three times the data let every Qwen seed escape the plateau (58.1–61.2%). On SmolLM2, LoRA stayed at 21.5–22.7% on all three seeds; we did not try either change there. Under the default budget, directly fixing a known mistake was more reliable.&lt;/p&gt;
&lt;p&gt;Ordinary SST-5 tells the opposite story. The model already read sentiment reasonably well, and the problem was improving that mapping. WSP reached at most 48.0%, while LoRA reached 59.0%. Even with 256 distinct examples, LoRA scored 54.2%. There was no small correction that matched what training learnt.&lt;/p&gt;
&lt;h3&gt;3.2 Programming can add facts. What does it cost?&lt;/h3&gt;
&lt;p&gt;Three independent Fable runs wrote the fictional-fact table into early-layer lookup circuits and each scored 100% on the 900 held-out phrasings. Default LoRA stayed near chance at 22.2%. After about 15 epochs and 40,500 presentations, LoRA reached 98.8%. WSP could therefore store knowledge that was absent from the base model; it did so by writing the supplied answers into a circuit, not by discovering them.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/figure-1.CK9g_WIa_24lxOv.webp&quot; alt=&quot;Two bar charts side by side. Left, accuracy on the edited task; right, MMLU after the change. Fictional facts: base model 21.1 and 59.6, LoRA after 15 epochs 98.8 and 62.0, WSP through memory 76.9 and 59.6, WSP bypass circuit 100.0 and 22.2. Twin-2K survey answers: base model 30.9 and 59.6, LoRA 42.8 and 60.0, WSP through edit 31.9 and 58.0, WSP preserve brief 35.2 and 57.6, WSP bypass circuit 45.0 and 23.4. A dashed line marks the answer prior of 47.1.&quot; width=&quot;1741&quot; height=&quot;855&quot; /&gt;&lt;figcaption&gt;Figure 1. Target accuracy (left) can hide damage to general ability (right). The fictional-facts bypass achieves 100% on the target but pushes MMLU near chance; the Twin-2K bypass shows the same pattern. The dashed line in the Twin-2K panel marks the per-question answer prior (47.1%), which no method beats. Further replications are in the repository.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The catch was the rest of the model. The bypass circuits changed early-layer computation used by ordinary inputs. On Qwen, they reduced MMLU from 59.6% to 22.2–25.8%, and next-token top-1 accuracy on WikiText-2 from 45.9% to almost zero. The Twin-2K prior circuit caused similar damage. On SmolLM2, another 100%-accurate fact circuit drove MMLU from 48.8% to 22.6%. The failure repeated across the two model families.&lt;/p&gt;
&lt;p&gt;Not every edit failed like this. An Opus programmer repurposed 900 neurons in the layer-8 MLP (of 28) to hold the facts, in a way related to factual model editing [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-9&quot;&gt;9&lt;/a&gt;]. It recalled 76.9% of facts while keeping MMLU at 59.6% and next-token top-1 at 45.6%. The difference is between a bypass circuit that dominates the model’s normal computation and a through edit that works with it.&lt;/p&gt;
&lt;p&gt;We also asked whether the instruction could change the choice. Under the original brief, preservation was not required. When told to preserve other abilities, the Fable programmer used a gated attention change on Twin-2K instead of a bypass circuit. Accuracy rose from 30.9% to 35.2%, while accuracy on the SST-5 dev set, an unrelated task, stayed at 42.2% (42.3% before editing). On fictional facts, the programmer could not find an edit that both learnt the table and met the preservation check. Keeping the model useful sometimes costs most of the gain.&lt;/p&gt;
&lt;p&gt;A related measurement problem appeared: some edits changed logit temperature. One mirrored-sentiment edit combined the swap with a temperature change. It raised WikiText-2 perplexity from 15.9 to about 1,800, which the swap alone does not do, while next-token top-1 accuracy stayed at 45.8% (base 45.9%); one rescaling of the logits brought its NLL back to 2.79 (base 2.77). Checking top-1 accuracy and general-knowledge performance separated these calibration effects from real damage. Target accuracy or raw perplexity alone would have given the wrong picture.&lt;/p&gt;
&lt;h2&gt;4. Programming, then LoRA&lt;/h2&gt;
&lt;p&gt;The two methods failed in different places. On the mirrored task, LoRA sometimes struggled to escape a confidently wrong start. On fictional facts, its default training budget was too short to store the table. Could a small programmed edit give training a better starting point?&lt;/p&gt;
&lt;p&gt;We applied LoRA after the non-destructive Opus factual-memory edit and after the sentiment embedding swap, using the same 4,000-presentation budget as LoRA alone. We ran three seeds for each combination. On mirrored sentiment we also trained LoRA after a hand-written version of the swap, and after the SmolLM2 programmer’s edit.&lt;/p&gt;
&lt;p&gt;Figure 2 shows why the starting point matters. Under the short training budget, LoRA alone had not stored the fictional-fact table. Beginning from a working factual memory let it refine that structure and reach 99.0–99.7% across all three seeds. On mirrored sentiment, the embedding swap removed the confidently wrong readout that had held back two LoRA seeds, and all three reached 57.3–58.5%. A hand-written swap of the two label words did just as well (57.6–58.5%), so the agent’s contribution was finding the swap; its other changes added nothing once LoRA trained. On Qwen, LoRA alone reached 58.1–61.2% with three times the data, so the edit saves training data rather than raising the ceiling. On SmolLM2, where LoRA alone failed on every seed at the default budget, the combination reached 55.9–56.6%; we did not run LoRA alone with more data there.&lt;/p&gt;
&lt;p&gt;With the edit as a starting point, 4,000 presentations matched what LoRA alone reached with 40,500 (98.8%). At the default learning rate we tried no budget in between, so the true saving may be smaller. Both see the same 900 facts, so the saving is in training presentations, not in facts. The combined models also kept general ability. MMLU stayed at 58.0–59.6% on facts and 58.0–58.6% on mirrored sentiment (base 59.6%; the 95% interval is about ±4 points), next-token top-1 at 45.5–45.8% (base 45.9%), and accuracy on the SST-5 dev set, an unrelated task, at 42.6–43.6% for the facts models (base 42.3%). On SmolLM2, the combined sentiment models kept MMLU at 46.6–48.0% (base 48.8%) and top-1 unchanged at 46.0%. Yang et al. [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-10&quot;&gt;10&lt;/a&gt;] found that LoRA, whether trained from the base model or on top of a weight patch, broke two neighbouring tasks. Here both starting edits worked through the model’s own pathways, and training on top of them left general ability intact.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/figure-2.DhiXP8Z5_ZAsz9Y.webp&quot; alt=&quot;Bar chart titled &apos;A programmed starting point saves LoRA training data&apos;. Fictional facts: WSP memory edit 76.9%, LoRA with 4k presentations 22.2%, edit then LoRA 4k 99.3% (seeds 99.0–99.7), LoRA with 40.5k 98.8%. Mirrored sentiment on Qwen: WSP swap edit 46.4%, LoRA 4k 33.6% (seeds 23.9–49.3), edit then LoRA 4k 58.0% (seeds 57.3–58.5), hand-written swap then LoRA 4k 58.0% (seeds 57.6–58.5), LoRA 12k 60.0% (seeds 58.1–61.2). Mirrored sentiment on SmolLM2: WSP edit 45.4%, LoRA 4k 22.2% (seeds 21.5–22.7), edit then LoRA 4k 56.2% (seeds 55.9–56.6).&quot; width=&quot;1741&quot; height=&quot;1208&quot; /&gt;&lt;figcaption&gt;Figure 2. A programmed edit as a starting point for LoRA. The same 4,000 training-presentation budget was used for LoRA alone and for the hybrids. Where three seeds were run, bars show their mean and printed ranges show their spread. Grey bars show LoRA alone with more data: 40,500 presentations for facts and 12,000 for mirrored sentiment (Qwen only; not run on SmolLM2). The hybrids kept general ability (Section 4).&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2&gt;5. Discussion and limitations&lt;/h2&gt;
&lt;p&gt;The practical distinction is between a fix we can write down and a mapping we still need to learn. When a model has the right information but reads it out wrongly, direct programming found a small, repeatable correction. When the answer was a finite table, programming could write the table into weights, sometimes at a severe cost to the model. So a written edit is not gentler than training by nature, as Yang et al. [&lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/#ref-10&quot;&gt;10&lt;/a&gt;] found for one patch; it depends on whether the edit works through the model or around it. For improving an ordinary input-to-answer mapping, LoRA was better in our tests. Starting LoRA from a safe edit cut the training it needed, by up to tenfold for facts and threefold for mirrored sentiment on Qwen, and was more useful than insisting that one method should replace the other.&lt;/p&gt;
&lt;p&gt;These findings come from 1.5–1.7B instruction-tuned models and a limited set of tasks. The replication on SmolLM2 covers only the two central regimes and the sentiment combination. We have 20 programming runs, only a few per task, and LoRA was not exhaustively tuned: three times the data fixed its mirrored-task seed failures on Qwen, we did not try that on SmolLM2, and we did not test the combination at that budget. The tasks differ in more than knowledge availability, and the two methods do not use identical kinds of computation. A programmer is allowed to build mechanisms from label tables, whereas LoRA updates weights through a fixed training procedure. Some agent runs used development-set selection; the audit and excluded-run records are available for inspection. These limitations matter when generalising the regime labels.&lt;/p&gt;
&lt;p&gt;For anyone changing a model, our lesson is to define what must not change before making the edit. Evaluate the target task, an unrelated task and general behaviour. If a non-destructive edit solves part of the problem, test whether gradient training can do the rest. A 100% target score is not enough when the model stops working elsewhere.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reproducibility and disclosure.&lt;/strong&gt; Code, result files and audits are at &lt;a href=&quot;https://github.com/Puneet-Bajaj-IITM/wsp-vs-lora&quot;&gt;https://github.com/Puneet-Bajaj-IITM/wsp-vs-lora&lt;/a&gt;. Claude (Anthropic) helped with coding, and ChatGPT (OpenAI) helped with copy-editing.&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;&lt;li&gt;Takehi, R., Teoh, J., Zhang, A., &amp;amp; Khattab, O. (2026). Sparks of Weight-Space Programming: LLMs can natively read &amp;amp; write neural network weights. Research blog. &lt;a href=&quot;https://rikiyat.github.io/blog/weight-space-programming/&quot;&gt;https://rikiyat.github.io/blog/weight-space-programming/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Hu, J., Tang, C., Li, W., et al. (2026). Exploring Weight-Space Programming: Capabilities, Generalization, and Limitations. &lt;a href=&quot;https://arxiv.org/abs/2611.09382&quot;&gt;arXiv:2611.09382&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Lehmann, J. (2026). Compiling Known Rules into Compact Neural Agents: Weight-Space Programming on Unseen Games. &lt;a href=&quot;https://arxiv.org/abs/2611.16981&quot;&gt;arXiv:2611.16981&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Goworek, R., Hickey, A., Nanni, F., &amp;amp; O’Reilly, M. (2026). Replicating and Extending Weight-Space Programming: Frontier LLMs Compile Programs into Weights and Read Input Layers. &lt;a href=&quot;https://arxiv.org/abs/2611.21449&quot;&gt;arXiv:2611.21449&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Socher, R., Perelygin, A., Wu, J., et al. (2013). Recursive Deep Models for Semantic Compositionality over a Sentiment Treebank. EMNLP.&lt;/li&gt;&lt;li&gt;Toubia, O., Gui, G. Z., Peng, T., et al. (2025). Twin-2K-500: A Dataset for Building Digital Twins of over 2,000 People Based on Their Answers to over 500 Questions. Marketing Science 44(6), 1446–1455.&lt;/li&gt;&lt;li&gt;Alain, G., &amp;amp; Bengio, Y. (2016). Understanding Intermediate Layers Using Linear Classifier Probes. &lt;a href=&quot;https://arxiv.org/abs/1610.01644&quot;&gt;arXiv:1610.01644&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Hu, E. J., Shen, Y., Wallis, P., et al. (2022). LoRA: Low-Rank Adaptation of Large Language Models. ICLR.&lt;/li&gt;&lt;li&gt;Meng, K., Bau, D., Andonian, A., &amp;amp; Belinkov, Y. (2022). Locating and Editing Factual Associations in GPT. NeurIPS.&lt;/li&gt;&lt;li&gt;Yang, Y., Huang, X., Wu, Y., Yang, H., &amp;amp; Zhou, R. Z. (2026). Writing Weights or Training Them? Spatial Reasoning through Weight-Space Programming and Low-Rank Adaptation. &lt;a href=&quot;https://arxiv.org/abs/2611.27089&quot;&gt;arXiv:2611.27089&lt;/a&gt;.&lt;/li&gt;&lt;/ol&gt;</content:encoded><category>Research</category></item><item><title>What If We Programmed Models Instead of Training Them?</title><link>https://puneetbajaj.dev/writing/programmed-models/</link><guid isPermaLink="true">https://puneetbajaj.dev/writing/programmed-models/</guid><description>When a model misbehaves, we fine-tune it. But if we already know what needs to change, do we still need the model to learn it? Experiments with weight-space programming and LoRA.</description><pubDate>Wed, 25 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When a model does not behave the way we want, our usual response is to fine-tune it. We collect examples, define a loss function, and let gradient descent figure out what needs to change.&lt;/p&gt;
&lt;p&gt;But what if we already know what needs to change? Do we still need the model to learn it?&lt;/p&gt;
&lt;p&gt;Recently, researchers demonstrated something called &lt;a href=&quot;https://rikiyat.github.io/blog/weight-space-programming/&quot;&gt;weight-space programming (WSP)&lt;/a&gt;, where an LLM can inspect another model’s weights, understand parts of its computation, and directly modify them without gradient descent.&lt;/p&gt;
&lt;p&gt;Coming from a software engineering background, I find this particularly interesting. Instead of teaching a system to behave differently through thousands of examples, we could potentially identify the problem and write a fix.&lt;/p&gt;
&lt;p&gt;I wanted to understand how far this approach could go and where traditional fine-tuning would still be better.&lt;/p&gt;
&lt;h2&gt;Does the model need to learn something new?&lt;/h2&gt;
&lt;p&gt;I started experimenting with predicting human survey responses using a small language model. Both fine-tuning and weight-space programming improved upon the base model, but neither beat a simple statistical baseline that predicted the most common answer to each question.&lt;/p&gt;
&lt;p&gt;The best programmed edit reached 45%, LoRA reached 42.8%, and the statistical baseline reached 47.1%.&lt;/p&gt;
&lt;p&gt;What was interesting was how the programmer achieved this improvement. Rather than getting better at understanding individuals, it essentially wrote population-level answer distributions into the model’s weights.&lt;/p&gt;
&lt;p&gt;This made me think about what we actually ask a model to do when we fine-tune it.&lt;/p&gt;
&lt;p&gt;Sometimes the model already has the necessary knowledge but uses it incorrectly. Sometimes we have information that we simply want to store in the model. And sometimes we need the model to learn a relationship that we cannot explicitly write down.&lt;/p&gt;
&lt;p&gt;These are different problems, so why should we expect the same approach to work best for all three?&lt;/p&gt;
&lt;h2&gt;Redirecting knowledge versus learning&lt;/h2&gt;
&lt;p&gt;Consider sentiment classification. What happens if we deliberately reverse the expected answers, so positive becomes negative and negative becomes positive?&lt;/p&gt;
&lt;p&gt;The base Qwen2.5-1.5B model scored just 4% on this task. However, it had not lost its understanding of sentiment. We had changed what we expected it to output.&lt;/p&gt;
&lt;p&gt;Across independent programming runs, agents discovered the same main fix: swap the embedding rows of two words, “negative” and “positive”. This alone brought accuracy to 46.2%. The same approach worked on a different model family, SmolLM2.&lt;/p&gt;
&lt;p&gt;LoRA, under the default training budget, struggled to learn this task in two out of three runs on Qwen.&lt;/p&gt;
&lt;p&gt;But when I tested ordinary sentiment classification, the results were reversed. Weight-space programming reached at most 48%, while LoRA reached 59%. Even with just 256 distinct training examples, LoRA performed better than the programmed edits.&lt;/p&gt;
&lt;p&gt;The distinction is important. In the first case, there was a specific mistake that could be corrected. In the second, the model needed to get better at a mapping it only partially understood.&lt;/p&gt;
&lt;h2&gt;A model that scores 100% but stops working&lt;/h2&gt;
&lt;p&gt;The next question was whether programming could add information that did not exist in the model.&lt;/p&gt;
&lt;p&gt;I created 900 facts about fictional people and asked programming agents to store them in the weights. Three independent runs achieved 100% accuracy, even when the questions were phrased differently from the training examples.&lt;/p&gt;
&lt;p&gt;It looked like a great result until I evaluated the rest of the model.&lt;/p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th&gt;Fact accuracy&lt;/th&gt;&lt;th&gt;MMLU accuracy&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Base model&lt;/td&gt;&lt;td&gt;21.1%&lt;/td&gt;&lt;td&gt;59.6%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Programmed lookup circuit&lt;/td&gt;&lt;td&gt;100%&lt;/td&gt;&lt;td&gt;22.2%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Programmed memory edit&lt;/td&gt;&lt;td&gt;76.9%&lt;/td&gt;&lt;td&gt;59.6%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The first edit had effectively built a lookup circuit inside the model, bypassing much of its existing computation. Its next-token prediction accuracy on ordinary text dropped to almost zero.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/figure-1.CK9g_WIa_24lxOv.webp&quot; alt=&quot;Two bar charts side by side: accuracy on the edited task and MMLU after the change. For fictional facts, the bypass circuit reaches 100.0% on the task while MMLU falls to 22.2%; the memory edit reaches 76.9% and keeps MMLU at 59.6%. For Twin-2K survey answers, the bypass circuit reaches 45.0% while MMLU falls to 23.4%.&quot; width=&quot;1741&quot; height=&quot;855&quot; /&gt;&lt;figcaption&gt;100% accuracy, but at what cost? Target accuracy (left) can hide damage to general ability (right). Figure 1 of the paper.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Another programmer took a different approach. It stored the facts through the model’s existing MLP pathway. It was less accurate at recalling the facts, but the model retained its measured general abilities.&lt;/p&gt;
&lt;p&gt;Interestingly, changing the instructions to explicitly require preservation of existing abilities also changed the kind of edit an agent produced in the survey task.&lt;/p&gt;
&lt;p&gt;This is something we need to consider when giving agents the freedom to modify models. If I only ask an agent to maximise accuracy on a task, I cannot assume it will preserve everything else.&lt;/p&gt;
&lt;h2&gt;Why not combine the two?&lt;/h2&gt;
&lt;p&gt;At this point, I was less interested in whether weight-space programming could beat fine-tuning and more interested in whether it could help fine-tuning.&lt;/p&gt;
&lt;p&gt;If a programmer can solve part of the problem directly, can gradient descent learn the remaining part more efficiently?&lt;/p&gt;
&lt;p&gt;Starting LoRA from the non-destructive factual-memory edit gave the following results:&lt;/p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Approach&lt;/th&gt;&lt;th&gt;Training presentations&lt;/th&gt;&lt;th&gt;Fact accuracy&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;LoRA&lt;/td&gt;&lt;td&gt;4,000&lt;/td&gt;&lt;td&gt;22.2%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;LoRA&lt;/td&gt;&lt;td&gt;40,500&lt;/td&gt;&lt;td&gt;98.8%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Programmed edit + LoRA&lt;/td&gt;&lt;td&gt;4,000&lt;/td&gt;&lt;td&gt;99.0–99.7%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The hybrid also retained general-knowledge performance across three seeds.&lt;/p&gt;
&lt;p&gt;On reversed sentiment, starting from the embedding swap allowed LoRA to learn consistently across both model families. Ordinary LoRA eventually learnt the task with three times the training presentations on Qwen.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/figure-2.DhiXP8Z5_ZAsz9Y.webp&quot; alt=&quot;Bar chart titled &apos;A programmed starting point saves LoRA training data&apos;. Fictional facts: LoRA with 4k presentations 22.2%, edit then LoRA with 4k 99.3% (seeds 99.0–99.7), LoRA with 40.5k 98.8%. Mirrored sentiment on Qwen: LoRA 4k 33.6%, edit then LoRA 4k 58.0%, hand-written swap then LoRA 4k 58.0%, LoRA 12k 60.0%. Mirrored sentiment on SmolLM2: LoRA 4k 22.2%, edit then LoRA 4k 56.2%.&quot; width=&quot;1741&quot; height=&quot;1208&quot; /&gt;&lt;figcaption&gt;Programming before training. With 4,000 training presentations, a programmed starting point matched what LoRA alone reached with 40,500; no budget in between was tried, so the real saving may be smaller. Figure 2 of the paper.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Even more interestingly, a simple hand-written swap worked just as well as the agent’s edit once LoRA was applied. The agent’s value was in discovering what needed to change.&lt;/p&gt;
&lt;p&gt;The reduction here is in training presentations, not unique facts, and programming itself has a computational and API cost. Whether the entire process is cheaper depends on those costs.&lt;/p&gt;
&lt;h2&gt;Where I think this becomes useful&lt;/h2&gt;
&lt;p&gt;I don’t think weight-space programming should replace fine-tuning. What interests me is using it before fine-tuning.&lt;/p&gt;
&lt;p&gt;When working with software, we don’t rewrite an entire system every time something behaves incorrectly. We try to understand where the problem is, what needs to change, and what should remain untouched.&lt;/p&gt;
&lt;p&gt;Perhaps model adaptation can benefit from a similar approach. Identify the parts of a problem we can explicitly solve, modify the model accordingly, and use gradient descent for the parts we still need to learn.&lt;/p&gt;
&lt;p&gt;These experiments are limited to small language models and a few tasks, so we don’t yet know how broadly this approach will work.&lt;/p&gt;
&lt;p&gt;But they suggest a different question to ask before we start fine-tuning a model:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What does the model actually need to learn, and what can we already fix?&lt;/strong&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;This article accompanies my working paper, &lt;a href=&quot;https://puneetbajaj.dev/papers/compile-learn-or-both/&quot;&gt;&lt;em&gt;Compile, Learn, or Both? When Weight-Space Programming Helps, What It Breaks, and Why Combining It with LoRA Matters&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For a longer walk-through where you can explore the recorded data yourself, read &lt;a href=&quot;https://puneetbajaj.dev/writing/programmed-models-interactive/&quot;&gt;&lt;em&gt;Weight-Space Programming, Step by Step&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://doi.org/10.5281/zenodo.24515792&quot;&gt;Read the paper on Zenodo&lt;/a&gt; · &lt;a href=&quot;https://github.com/Puneet-Bajaj-IITM/wsp-vs-lora&quot;&gt;GitHub repository, experiments and results&lt;/a&gt;&lt;/p&gt;</content:encoded><category>Experiment</category></item><item><title>Simulated Crowds: Why Sounding Real Isn&apos;t Enough</title><link>https://puneetbajaj.dev/writing/simulated-crowds/</link><guid isPermaLink="true">https://puneetbajaj.dev/writing/simulated-crowds/</guid><description>Two vendors can give the same concept opposite verdicts, and both may be describing their systems correctly. Sounding like a consumer, explaining a choice and predicting it are different jobs.</description><pubDate>Fri, 30 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Give two research vendors the same concept and you can get two different verdicts. One says it wins. The other calls it middling. Both sell “synthetic consumers”, and both may be describing their systems correctly.&lt;/p&gt;
&lt;p&gt;They built different machines.&lt;/p&gt;
&lt;p&gt;From outside, we might only see a report with percentages and convincing shopper quotes. But one system could be asking an LLM to act like a persona, another could be learning from past choices, and a third could be using information about particular people. That difference matters when we try to use those answers for a decision.&lt;/p&gt;
&lt;h2&gt;An explanation is not a prediction&lt;/h2&gt;
&lt;p&gt;Say a person bought the cheaper frozen meal. Ask an LLM why, and it can explain the choice through price, convenience or a family budget. All of those sound reasonable. But could it have picked that meal before we told it what the person bought? Explaining a decision after seeing it is a different job from predicting it.&lt;/p&gt;
&lt;p&gt;The same problem becomes harder when we ask a thousand simulated people. We may get a neat distribution and different-looking responses, but are they different people making different trade-offs? Or is it one model giving us many versions of what a sensible shopper would say?&lt;/p&gt;
&lt;h2&gt;We need the count and the reasons&lt;/h2&gt;
&lt;p&gt;Most consumer teams already know why a concept might fail. People notice price. Some dislike ingredients; others care about convenience. The useful question is: &lt;strong&gt;should we change this claim or keep it?&lt;/strong&gt; If 60% prefer claim A, who are the other 40%? Would fixing it for one group push away the other?&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/four-kinds.BMN6nitD_ZbxUe5.webp&quot; alt=&quot;A two-by-two grid. Grounded and obvious: truisms, such as ‘People notice price’. Grounded and surprising: real insights, such as ‘Parents trust no artificial colors more than high protein’. Ungrounded and obvious: filler, such as ‘Shoppers want quality’. Ungrounded and surprising: hallucinations, such as ‘Blue packaging will double sales’.&quot; width=&quot;1672&quot; height=&quot;941&quot; /&gt;&lt;figcaption&gt;Figure 1. Four kinds of research output. These are illustrative examples, not measured consumer findings.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;That is why I separate obvious truths, filler, unsupported claims and real insights. A surprising claim is not automatically useful. Before acting on it, I want to know whether it came from evidence, and how many people it actually represents.&lt;/p&gt;
&lt;h2&gt;Where the crowd can go wrong&lt;/h2&gt;
&lt;p&gt;The first problem can happen even before simulation. Who answered the original survey? Who did not? Which retailers supplied the purchase data? If the starting sample misses an important group, changing the model will not bring those people back.&lt;/p&gt;
&lt;p&gt;Then we have to represent the people we did observe. Two shoppers can have the same age, income and city, yet make opposite decisions. One may pay more for taste and convenience. The other may look first at price and ingredients. Demographics tell us something about a group, but they do not tell us how everyone inside that group decides.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;https://puneetbajaj.dev/_astro/same-demographics.C8iQNxEP_Z1bEYAo.webp&quot; alt=&quot;Two people with the same age, income and city. Person A is driven by taste and convenience and would try the product. Person B is driven by price and ingredients and would skip it. Matching demographics is not enough; decision drivers matter too.&quot; width=&quot;1619&quot; height=&quot;971&quot; /&gt;&lt;figcaption&gt;Figure 2. Same demographics can still lead to different choices. The people and decisions are illustrative.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;A prompted persona gives an answer quickly, which makes it useful for finding possible themes or drafting questions. I would be more careful about using those responses to estimate market shares. Finding an objection is not the same as knowing how common it is. Statistical models and models trained on real choices can help with different parts of the problem, but they need suitable data and their own checks.&lt;/p&gt;
&lt;p&gt;GANs offer a useful analogy. Fooling a trained, finite discriminator does not prove that the generated distribution matches the real one; important parts may still be missing. Similarly, a consumer model can sound convincing without predicting the actual decisions. A good explanation of something wrong can make it look right.&lt;/p&gt;
&lt;p&gt;Even when the individual predictions are reasonable, we can still go wrong when turning them into a population number. Weights may be off, and a summary can hide the people who disagree. Asking the same model ten times is not the same as interviewing ten independent consumers.&lt;/p&gt;
&lt;h2&gt;What should a digital twin actually know?&lt;/h2&gt;
&lt;p&gt;A digital twin is not necessarily an LLM with a long interview pasted into the prompt. It might use previous answers, observed purchases, a choice model or retrieval. More information about a person can help, but only when we can connect it to the question we are asking.&lt;/p&gt;
&lt;p&gt;Suppose I know what somebody buys for breakfast. Does that help me predict the price they would accept for a frozen dinner? Maybe, but I would not assume it does. Passing the whole profile to an LLM can also bury the useful part. The harder task is choosing the few signals that matter for this decision, and knowing when the evidence is too weak.&lt;/p&gt;
&lt;p&gt;People change as well. A lost job can change a price decision; friends can change what looks appealing. Agent simulations can help us explore those situations, but a plausible story about a product going viral is not a forecast.&lt;/p&gt;
&lt;h2&gt;Which machine gave us the answer?&lt;/h2&gt;
&lt;p&gt;I do not see one method replacing the others. Before trusting a synthetic crowd, I would ask where its answers came from, what real decisions it was checked against, and whether the estimate still represents the people who disagree.&lt;/p&gt;
&lt;p&gt;A useful simulation has to reproduce both the decisions and the differences between people. Sounding like a consumer, explaining their decisions, and predicting their decisions are not the same thing.&lt;/p&gt;
&lt;p&gt;I later tested several common approaches on public survey data. The companion article, &lt;a href=&quot;https://puneetbajaj.dev/writing/why-the-median-was-hard-to-beat/&quot;&gt;“Why the Median Was Hard to Beat”&lt;/a&gt;, explains what the experiments showed. The methods and results are in the research paper, &lt;a href=&quot;https://puneetbajaj.dev/papers/when-the-average-looks-right/&quot;&gt;&lt;em&gt;When the Average Looks Right&lt;/em&gt;&lt;/a&gt;, and the &lt;a href=&quot;https://github.com/Puneet-Bajaj-IITM/simulated-crowds-eval&quot;&gt;public evaluation repository&lt;/a&gt;.&lt;/p&gt;</content:encoded><category>Essay</category></item><item><title>The Validation Gap</title><link>https://puneetbajaj.dev/writing/the-validation-gap/</link><guid isPermaLink="true">https://puneetbajaj.dev/writing/the-validation-gap/</guid><description>AI is making it easier to build things. But are we losing the time and expertise needed to check what we&apos;re building?</description><pubDate>Sat, 25 Jul 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Who is responsible when an engineer ships AI-generated work and it turns out to be wrong? The engineer, the company, or the model provider?&lt;/p&gt;
&lt;p&gt;In July, I asked this and several related questions to the head of AI engineering at an applied-AI startup. We were interviewing industry experts for a team study on how AI and big data might change the most valuable work by 2030.&lt;/p&gt;
&lt;p&gt;He had around twelve years of experience in applied AI and agentic systems. He also hired engineers, managed an engineering team, and controlled its AI budget. That made the conversation interesting because he was looking at the same problem from three sides: what skills engineers need, how teams actually work, and where companies spend money.&lt;/p&gt;
&lt;p&gt;I tried to ask about things he had experienced rather than collect predictions about the future. We discussed hiring, AI-generated mistakes, changing expectations, and investment decisions.&lt;/p&gt;
&lt;p&gt;Six observations came out of the conversation. Initially, they looked like separate problems. But when I started connecting them, I kept coming back to one question: &lt;strong&gt;we are giving AI more responsibility for producing work, but are we building enough capacity to verify that work?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have started calling this the &lt;em&gt;validation gap&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;When execution stops being the bottleneck&lt;/h2&gt;
&lt;p&gt;One of my first questions was what he expects to become more valuable for engineers by 2030.&lt;/p&gt;
&lt;p&gt;His answer was interesting. He thinks the bottleneck is moving away from knowing how to implement something and toward knowing what is worth implementing. He used the word &lt;em&gt;taste&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Think about what this means for engineering. Earlier, having an idea and turning it into a working implementation required substantial technical effort. AI is reducing some of that effort. But it doesn’t automatically tell us whether the idea is useful, whether the implementation solves the right problem, or whether we’ve missed something important.&lt;/p&gt;
&lt;p&gt;So the scarce skill starts shifting from execution toward judgement.&lt;/p&gt;
&lt;p&gt;This connects with an apparent contradiction in the World Economic Forum’s &lt;em&gt;Future of Jobs Report 2025&lt;/em&gt;. Employers rank analytical thinking as their most important skill, while AI and big data are the fastest-growing skills.&lt;/p&gt;
&lt;p&gt;I don’t think those findings contradict each other. As more implementation becomes automated, choosing what to build and judging whether it works become more important.&lt;/p&gt;
&lt;p&gt;But that creates another problem. Good judgement usually comes from experience, and experience comes partly from doing the work.&lt;/p&gt;
&lt;h2&gt;The engineer is still responsible, even when AI does the work&lt;/h2&gt;
&lt;p&gt;I asked him whether an AI-generated output had ever turned out to be wrong after reaching a customer, how the mistake was discovered, and who should be accountable.&lt;/p&gt;
&lt;p&gt;His position was clear: using AI doesn’t transfer responsibility to the model provider. The engineer still owns what gets shipped.&lt;/p&gt;
&lt;p&gt;That seems reasonable. But consider what is changing around that responsibility.&lt;/p&gt;
&lt;p&gt;When an engineer writes a system, they understand many of the decisions that went into it. They may still make mistakes, but they have some understanding of why the system behaves the way it does.&lt;/p&gt;
&lt;p&gt;Now suppose an AI agent produces most of the implementation. The engineer reviews the result, but may not have followed every decision along the way. To validate it properly, they need enough expertise to notice what is wrong, including mistakes that look perfectly reasonable at first.&lt;/p&gt;
&lt;p&gt;And that is where the pressure starts building.&lt;/p&gt;
&lt;p&gt;The interviewee described business deadlines reducing the time available for validation and testing. At the same time, as AI takes over more implementation work, engineers risk losing some of the hands-on experience that helps them recognize errors.&lt;/p&gt;
&lt;p&gt;So we have a strange situation: &lt;strong&gt;the person responsible for catching AI mistakes may be losing both the visibility and the time needed to catch them.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is what I mean by the validation gap. The problem isn’t simply that AI makes mistakes. Every engineering process does. The problem is that our ability to find those mistakes may not be growing at the same rate as our ability to produce work.&lt;/p&gt;
&lt;h2&gt;Where will the next generation of experienced engineers come from?&lt;/h2&gt;
&lt;p&gt;This led me to another question.&lt;/p&gt;
&lt;p&gt;If AI can do much of the work previously assigned to junior engineers, what happens to the people who would have learned through those jobs?&lt;/p&gt;
&lt;p&gt;His concern was that if companies stop hiring juniors, they also stop developing some of their future seniors.&lt;/p&gt;
&lt;p&gt;That matters because senior-level judgement is exactly what we are depending on to catch AI-generated mistakes.&lt;/p&gt;
&lt;p&gt;We might save effort today by automating entry-level work, but some of the cost could appear years later. Fewer people get the experience needed to understand systems deeply, debug unusual failures, or question an apparently correct output.&lt;/p&gt;
&lt;p&gt;He didn’t think this necessarily meant all engineering demand would disappear. His observation was that AI-related opportunities were spreading beyond big technology companies, even while layoffs continued elsewhere.&lt;/p&gt;
&lt;p&gt;The WEF projects 78 million net new jobs by 2030. But that number doesn’t tell us whether the new jobs will provide the same entry-level learning opportunities as the jobs being lost.&lt;/p&gt;
&lt;p&gt;This also changes how companies hire.&lt;/p&gt;
&lt;p&gt;When I asked what he looks for today that mattered less a year earlier, he mentioned curiosity, proactiveness, and the willingness to learn. Building applications with LLMs had gone from a distinguishing skill to something increasingly expected.&lt;/p&gt;
&lt;p&gt;If the tools themselves change that quickly, knowing one framework or model isn’t enough. What matters is how quickly someone can learn the next one.&lt;/p&gt;
&lt;p&gt;The WEF estimates that 39% of workers’ core skills will change by 2030. His hiring experience gave me a practical explanation for why adaptability is becoming so important.&lt;/p&gt;
&lt;p&gt;But adaptability alone doesn’t solve the experience problem. Engineers still need opportunities to develop the judgement that makes their learning useful.&lt;/p&gt;
&lt;h2&gt;When spending becomes a measure of progress&lt;/h2&gt;
&lt;p&gt;The other side of the interview was about money.&lt;/p&gt;
&lt;p&gt;He described an industry habit he called &lt;strong&gt;“token maxing”&lt;/strong&gt;: using the newest models, maximizing their usage, and accepting the resulting costs.&lt;/p&gt;
&lt;p&gt;He expects companies eventually to pay more attention to open-source and locally deployed models. Salaries remain a larger expense in his experience, but spending on model usage is becoming harder to ignore.&lt;/p&gt;
&lt;p&gt;What interested me wasn’t just the cost. It was how companies decide whether the spending is justified.&lt;/p&gt;
&lt;p&gt;He made another observation when we discussed the WEF’s forecast for AI skills. Some companies, he argued, are increasing AI hiring partly because reports like these tell them AI is where the industry is heading.&lt;/p&gt;
&lt;p&gt;That creates a feedback loop. A forecast encourages companies to invest, and that investment then becomes evidence that the forecast was right.&lt;/p&gt;
&lt;p&gt;I’m not suggesting these reports create AI adoption on their own. But they can influence the decisions they are supposed to describe.&lt;/p&gt;
&lt;p&gt;McKinsey’s &lt;em&gt;Superagency in the Workplace&lt;/em&gt; report found that 92% of companies planned to increase AI investment, while only around 1% described their AI deployments as mature. Stanford’s &lt;em&gt;AI Index&lt;/em&gt; reported $252.3 billion in corporate AI investment in 2024.&lt;/p&gt;
&lt;p&gt;Those figures show how much attention and money AI is attracting. They don’t, by themselves, tell us how much useful work that investment produces.&lt;/p&gt;
&lt;p&gt;That is the measurement problem.&lt;/p&gt;
&lt;p&gt;If a team cannot clearly measure the value of its AI systems, it may start using easier numbers as substitutes: model spending, tokens consumed, code generated, or features shipped.&lt;/p&gt;
&lt;p&gt;But more tokens don’t necessarily mean better decisions, just as more lines of code don’t necessarily mean more productivity.&lt;/p&gt;
&lt;h2&gt;The two loops behind the validation gap&lt;/h2&gt;
&lt;p&gt;For our team’s final report, I tried connecting these observations in an influence diagram. Two reinforcing loops stood out.&lt;/p&gt;
&lt;figure&gt;&lt;div&gt;Influence diagram: the proxy loop and the pipeline loopAI adoption increases judgement load and decreases entry-tier roles. Higher judgement load decreases verification time per item; fewer entry-tier roles decrease domain knowledge after a long delay. Less verification time and less domain knowledge both increase the error escape rate, which increases liability exposure while accountability stays with the engineer. Return on AI spend is not observable, so spend becomes the proxy that drives further adoption.+−−+−−+AI adoptionspend per professionalReturn on AI spendnot observableJudgement loadflags, drafts, outputsEntry-tier rolesjuniors, L1/L2 analystsVerification timeper itemDomain knowledgeslow to rebuildError escape ratewrong output shippedLiability exposureaccountability unchangedspend becomesthe proxyR1 · proxy loopreturn unseen, spend risesR2 · pipeline loop&lt;/div&gt;&lt;figcaption&gt;Two reinforcing loops in AI adoption. R1, the proxy loop: return on AI spend cannot be observed, so spend itself becomes the signal of progress. R2, the pipeline loop: entry-level work is where domain knowledge is built, and removing it lowers, years later, the expertise needed to catch AI errors.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The first is what I call the &lt;strong&gt;proxy loop&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;When the return from AI investment is difficult to measure, spending and adoption can become substitutes for progress. Companies invest more, deploy more systems, and point to increasing usage. But unless they also measure the quality and value of the work being produced, the original uncertainty remains.&lt;/p&gt;
&lt;p&gt;The second is the &lt;strong&gt;pipeline loop&lt;/strong&gt;, and I think it is the more concerning one.&lt;/p&gt;
&lt;p&gt;As AI handles more entry-level work, companies may create fewer opportunities for junior engineers to gain experience. Over time, that can reduce the pool of people with the practical expertise needed to validate complex AI-generated work.&lt;/p&gt;
&lt;p&gt;The loops operate on different timescales. The spending loop can move quickly. The talent pipeline takes years to change.&lt;/p&gt;
&lt;p&gt;But both connect back to the same problem: AI-generated output is increasing, while the ability to verify it may not be keeping up.&lt;/p&gt;
&lt;p&gt;One interview doesn’t establish that every engineering organization is moving in this direction. But it helped me connect several things that are often discussed separately: AI adoption, hiring, skills, cost, and accountability.&lt;/p&gt;
&lt;p&gt;And it changed how I think about AI productivity.&lt;/p&gt;
&lt;p&gt;I wouldn’t measure success only by how much faster a team can ship. I’d also want to know how much of that work was actually validated, whether engineers understand what they’re approving, and whether the team is still developing the expertise it will need in the future.&lt;/p&gt;
&lt;p&gt;For me, the scarce resource isn’t just engineering time anymore. It’s &lt;strong&gt;verification capacity&lt;/strong&gt;: the time, visibility, and experience needed to tell whether the work is correct.&lt;/p&gt;
&lt;p&gt;If we keep increasing how much AI produces without protecting our ability to check it, the gap won’t necessarily show up in our productivity numbers.&lt;/p&gt;
&lt;p&gt;It may show up when the work reaches a customer.&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;About this piece&lt;/h3&gt;
&lt;p&gt;This essay grew out of a team study for IIT Madras’s BSGN3001 course, &lt;em&gt;Strategies for Professional Growth: Skills, Security &amp;amp; Capital — How AI and Big Data are Transforming the Most Valuable Work of 2030&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The project team included Harkishan Singh Baniya, Dnyaneshwari Mahajan, Hilal Abdul Azeez, Aditya Kumar, and me. Each of us interviewed one expert. My teammates interviewed a mathematics professor, a cybersecurity specialist, a finance educator, and a business consultant.&lt;/p&gt;
&lt;p&gt;Their interviews also raised questions around judgement, oversight, and learning agility. This article draws specifically on my own interview and the influence diagram I developed for our final report. The interview was recorded with consent, and the interviewee remains unnamed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Research referenced:&lt;/strong&gt; World Economic Forum, &lt;em&gt;Future of Jobs Report 2025&lt;/em&gt;; McKinsey, &lt;em&gt;Superagency in the Workplace&lt;/em&gt; (2025); Stanford HAI, &lt;em&gt;AI Index Report 2025&lt;/em&gt;.&lt;/p&gt;</content:encoded><category>Essay</category></item></channel></rss>