LoKI: Low-damage Knowledge Implanting of Large Language Models
Citation. Runyu Wang (School of Information Science and Technology, Nantong University) and Peng Ping (School of Transportation and Civil Engineering, Nantong University, corresponding author). Then Zhengyu Guo (South China University of Technology), Xiaoye Zhang (China Southern Power Grid Company Limited) and Quan Shi (Nantong, Transportation). Then Liting Zhou (Dublin City University) and Tianbo Ji (Nantong, Transportation). "LoKI: Low-damage Knowledge Implanting of Large Language Models". arXiv:2505.22120, version 2 of 23 November 2025. Version 1 is of 28 May 2025.
Venue: AAAI-26. The AAAI Press page lists it in the Proceedings of the AAAI Conference on Artificial Intelligence 40(39), pages [removed]. The page gives the date 14 March 2026, with DOI 10.1609/aaai.v40i39.40651. The v2 PDF carries an AAAI 2026 copyright line. The "Oral" label comes from the arXiv comment ("AAAI-26 Oral") and the authors' code README. We did not find it on an AAAI page. Code is at github.com/Nexround/LoKI, and a project page is at nexround.github.io/LoKI-Page. The training datasets are public releases by other groups. Funding: the National Natural Science Foundation of China (grants 52202496, 52442218 and U2433216). Also the Key Research and Development Project of Nantong City (GZ2024001), and the Key Laboratory of Target Cognition and Application Technology (2023-CXPT-LC-005).
Status. Planned. #4782 (catastrophic interference, weight-space programming and LoRA) would use it in its synthesis page. It also adds evidence to the open #5118 (Fisher importance) and #5133 (weight change at a pole). The maintainer designs the campaign to fix models, so this page reports evidence and records questions only.
Read. On 2026-11-19 we downloaded the arXiv v2 PDF (16 pages) and extracted its text with pdftotext. The reader was this page's author, a model (Claude Opus 5.5). We read all of the extracted text in the source's own words. That is the abstract, the introduction, related works, background, method, experiments, ablations, conclusions, acknowledgement and references. It also includes Appendices A to H, with Tables 1 to 17 and the LoKILinear listing as text. We did not see Figures 1 to 5 as images, so this page gives only their captions and axis labels. We did not read version 1 or the AAAI proceedings PDF. We also read the AAAI Press page's metadata and the current code on GitHub (last push 2026-04-11), to check what the text leaves unclear. That code is later than v2, so it may differ from the code that made the results.
Summary
Claim. Fine-tuning damages less of a model's general skill when it updates only the weights that contribute least to that skill. LoKI finds these weights with a gradient attribution on MMLU. It spreads them equally across layers, and trains only them.
Method.
- The unit. The paper calls each row v_j of the down-projection W_down a "knowledge vector". W_down is d_model × d_ff, so row j writes output coordinate j of the MLP, a residual-stream coordinate. The text calls this coordinate a "knowledge output node". The code splits W_down by output rows, and the heatmap axes run to about 1,000 for Qwen2.5-0.5B and 4,400 for Llama. So a unit is one residual coordinate of one layer, and it spans all d_ff MLP neurons.
- Knowledge Vector Attribution (KVA). KVA applies Integrated Gradients to each node's output, with a zero baseline and m = 7 Riemann steps. The target is "the target logit". It runs on MMLU, at about 9.69 seconds a sample for Llama3.1-8B-Instruct on an RTX 4090. The reduced set takes the first 50 samples of each MMLU subject.
- The Layer-Balanced Strategy. A quota q% of all nodes is split equally across layers. For each sample and layer, the method counts the k_l nodes with the smallest attribution. Each layer then keeps the k_l nodes chosen most often.
- Implanting. Only the chosen rows of each W_down train. All other parameters are frozen. A LoRA variant (LoKI*) puts a low-rank update on the chosen rows only.
- Tasks. Llama3.1-8B-Instruct is fine-tuned on the ToolACE function-calling data and scored on the Berkeley Function Calling Leaderboard V3. Qwen2.5-0.5B-Instruct is fine-tuned on the LB Reranker data and scored on 9 BEIR datasets, with the first 250 queries of each.
- Forgetting. Six benchmarks in OpenCompass: TriviaQA, GSM8K, HellaSwag, WinoGrande, HumanEval and IFEval. "Avg" is the mean relative drop from the untuned model, in percent.
- Baselines. LoRA (the dataset providers' ToolACE model), DoRA, PiSSA and CorDA. The LB-Reranker is the providers' full fine-tune. Ablations zero the top 1% of nodes by high or low attribution (S-H, S-L). They also train the top q% of nodes chosen globally, without layer balance (G-H, G-L).
Findings, as the source reports them.
| Setting | Result |
|---|---|
| ToolACE, Llama3.1-8B, BFCL overall accuracy (Table 1) | LoKI q=30 58.93%, DoRA 58.90%, ToolACE LoRA 58.32%, PiSSA 53.97% |
| ToolACE, multi-turn accuracy (Table 1) | LoKI q=20 17.75%, DoRA 16.00%, ToolACE LoRA 7.62% |
| ToolACE, forgetting Avg (Table 2) | LoKI q=10 0.34% (188M parameters), q=20 0.93%, q=30 1.23% (563M), LoKI* 1.26% (16M) |
| ToolACE, forgetting Avg of baselines (Table 2) | DoRA 4.92% (43M), ToolACE LoRA 16.11% (42M), PiSSA 48.93% (42M) |
| LB Reranker, Qwen2.5-0.5B, BEIR at rank 1 against the full fine-tune (Table 3) | LoKI q=30 +1.0 MAP and +2.5 P. LoKI q=5 −3.1 MAP, CorDA −3.3 MAP, DoRA −8.7 MAP |
| LB Reranker, forgetting Avg (Table 4) | LoKI q=5 6.12%, q=10 8.86%, q=20 1.70%, q=30 0.46%. Full fine-tune 84.13%, CorDA 84.22%, PiSSA 48.95%, DoRA 12.23% |
| Zeroing the top 1% of nodes, Llama3.1-8B (Tables 5a, 16) | S-H Avg 36.73% (GSM8K 84.46 to 15.16). S-L Avg 11.35% |
| Layer balance, Qwen2.5-0.5B, q=10 (Tables 5b, 15) | LoKI 8.86%, G-H 39.04%, G-L 30.48% |
| KVA stability, Qwen2.5-0.5B, q=10 (Tables 6, 7) | Node overlap 97.42% between m=7 and m=20. 95.13% between the reduced and full MMLU |
| KVA stability, Llama3.1-8B (Table 8) | 97.57% overlap between the reduced and full MMLU |
| Learning rates (Tables 9, 11, 13) | Reranker LoKI 1.0×10⁻⁵ (q=5, 10) to 4.0×10⁻⁶ (q=30). ToolACE LoKI 9.0×10⁻⁶, and ToolACE DoRA and PiSSA 1.0×10⁻⁴ |
The paper also reports that high- and low-contribution nodes are dense in the same layers (Figures 2 to 5). We read this only from the text and the captions.
Where the claims go beyond the evidence
- The "knowledge vector" is not a neuron. The text cites knowledge neurons and key-value memories, where a unit is one of the d_ff neurons. But LoKI's unit is a W_down row, a residual coordinate. Equation 3 writes z_l,j = u_l,j W_down,j·, which uses one index for both. The method holds either way, but its claims about where the model stores knowledge are about residual coordinates.
- No random layer-balanced baseline. The ablation compares low-attribution rows, balanced, with high or low rows chosen globally. It does not train random rows under the same layer quota. So the tables cannot separate the effect of KVA from the effect of spreading updates across layers. The zeroing test has no random set of 1% either.
- Learning rates and sizes differ between methods. On ToolACE, LoKI trains at 9.0×10⁻⁶ and DoRA and PiSSA at 1.0×10⁻⁴. LoKI q=10 trains 188M parameters, against about 42M. A lower learning rate alone may forget less. The authors say that higher q used lower rates, and give this as their reason for the q=30 reranker result.
- One run for each setting. No table gives seeds, intervals or tests. LoKI q=30 leads DoRA on BFCL overall by 0.03 points. The reranker Avg is not monotone in q: 6.12% at q=5 and 8.86% at q=10.
- The forgetting score lets gains offset losses. Avg is a mean of relative drops. LoKI q=30 on Qwen2.5-0.5B raises HellaSwag from 30.98 to 38.39, which offsets drops elsewhere.
- The text and the code disagree in places. This is our reading of the current code, which is later than v2. The code attributes to the softmax probability of the predicted label, not to a logit. Its selection takes the lowest signed, min-max scaled score. So the most negative attributions are chosen, not the smallest in size. The text does not discuss the sign.
- Two models, two tasks. The abstract says "various model architectures". Training covers Llama3.1-8B-Instruct and Qwen2.5-0.5B-Instruct only, and Llama2-7B has a heatmap only. Both are instruction-tuned models.
- The layer-density finding has no statistic. The paper calls it "a novel phenomenon" from heatmaps, and leaves its study to future work.
- Small errors in the text. The main text puts the ToolACE setup in Appendix D and the reranker setup in Appendix E. The PDF has them the other way round. The text reads a lower BFCL "Irrelevance" score as less hallucination, and marks the column ↓. We did not check BFCL's definition of that column.
- Credit. The authors state limits themselves: q must be tuned for each task and model, KVA costs time, and the LoRA interaction is not studied. They release code. The forgetting benchmarks do not include MMLU, which KVA uses to choose the rows.
Use in this repo
- The paper's unit differs from the repo's. The repo's unit is an MLP neuron pole: one row of W_gate and W_up, and one column of W_down. LoKI's unit is a row of W_down, which crosses every neuron of the layer. So the paper says nothing direct about single neurons, explanations, probes or nulls.
- Under LoKI, a pole's input weights do not change. This is our inference from the method, not a claim of the paper. LoKI freezes W_gate and W_up, so each pole computes the same function of its layer's input. Its activation moves only through changes in earlier layers' outputs. Its output vector changes only in the q% of chosen coordinates.
- Evidence for #5133. #5133 reads the norm of the instruct-minus-base change in each pole's own Wgate, Wup and Wdown rows and columns. LoKI suggests a second split of the same change, by W_down row, so that each residual coordinate has its own norm. This is a comment for #5133, not a new issue.
- Evidence for #5118. #5118 asks whether a pole's diagonal Fisher predicts whether its explanation keeps. KVA is a related importance score, from integrated gradients on MMLU answers. LoKI's zeroing test (S-H 36.73% against S-L 11.35%) supports such scores at the coordinate level. It has no random null, and #5118 already plans one.
- The repo already scores units by attribution, with a check.
open-interpretability pole-effectsestimates each pole's effect on the loss by attribution patching (docs/analyses/pole-effects.md). On Qwen2.5-0.5B, the base of LoKI's Qwen model, it scores 233,472 poles. The Spearman with exact ablation is 0.85 on 60 poles. The median exact effect of the top 1% is 0.00028 nats, against 0.00002 nats for uniform poles. LoKI checks KVA only for stability across settings (95–97% overlap), not against exact ablation. - LoKI measures importance once. LoKI computes KVA once per model and does not measure it again after training. In
papers/neuron-development/, Pythia-70m's 86 VERIFIED poles keep changing after the loss settles. Their median correlation with the final form is 0.62 at step 16,000. Adjacent checkpoints correlate at a median of 0.78 to 0.82. A one-time importance score may thus go stale during a long run, and LoKI does not test this. - The instruct base is not neutral. LoKI starts from instruction-tuned models.
docs/analyses/base-instruct.mdshows that the Qwen2.5-0.5B instruct step already changes some explanations: 252 of 311 VERIFIED poles keep (81%). So LoKI's "general skill" is the skill after one fine-tune. - For a fix guided by an explanation.
fixing-models.mdholds the repo's synthesis, with the #4781 " days" error as its case. That route runs through layer-0 neurons and the copy heads L3/H3, L4/H0 and L4/H7. LoKI trains MLP down-projections only, so it would not touch those heads. LoKI also chooses the rows that matter least, which is the opposite of a fix at explained units. - The tests that LoKI lacks. The fix tests in
fixing-models.mdinclude hard negatives on the same route and a matched random null. LoKI reports benchmark averages only. For #4781, the hard negatives are the shortlist prompts where copying is right. - Layer balance agrees with an earlier review. In Does Localization Inform Editing?, Causal Tracing does not predict the best layer to edit. LoKI finds that updates kept in a few high- or low-importance layers forget more than updates spread across layers. Both results caution against a fix placed by one importance map. They differ in method, model and task, so this is a link to test, not a match.
- A question for the maintainer. A VERIFIED explanation describes when a pole is active. A LoKI-style update keeps each pole's input weights and changes its output vector. Does an explanation that keeps its probes then count as kept, even if the pole's effect downstream changes? This is a choice for the fix campaign, so this page records it as a question and opens no issue.
- A follow-up that reads weights and gradients. Run KVA on Qwen2.5-0.5B with the authors' code, and rank the W_down rows of each layer. Then test whether the instruct-minus-base change falls more on low-KVA rows than on high-KVA rows, against shuffled rows. Also test whether failing poles write more to the rows that changed most. This trains nothing and shares rows with #5133.