Source-linked AI summary
Adaptive Token Biaser: Knowledge Editing via Biasing Key Entities
Baolong Bi, Shenghua Liu, Yiwei Wang, Lingrui Mei, Hongcheng Gao, Yilong Xu, Xueqi Cheng
TL;DR
LLM knowledge can become outdated, and stubborn facts are difficult to edit through context prompts alone. ATBIAS targets knowledge-related tokens by matching entities and biasing their logits during ICE decoding. The authors report up to a 32.3% improvement over state-of-the-art decoding methods with half the latency.
Problem
LLM facts can quickly become outdated, retraining is costly, and stubborn knowledge is challenging to edit through context prompts alone.
Source: §1 · p. 1Method
ATBIAS extracts new and parametric knowledge entities, filters likely tokens, and biases logits for matched tokens during ICE decoding.
Source: §1 · pp. 1–2Results
Up to a 32.3% improvement over state-of-the-art decoding methods with only half the latency is reported for ATBIAS.
Source: §1 · p. 2Takeaways & Limitations
The authors conclude that ATBIAS can be widely applied to LLMs with negligible cost.
Source: §6 · p. 9Evaluation mainly covers LLAMA2-7B-CHAT, LLAMA2-13B-CHAT, and MISTRAL-7B-INSTRUCT, and tests ATBIAS with only IKE and MeLLo; other models and ICE methods remain less explored.
Source: Limitations · p. 9
Abstract
from arXiv · showhide
The parametric knowledge memorized by large language models (LLMs) becomes outdated quickly. In-context editing (ICE) is currently the most effective method for updating the knowledge of LLMs. Recent advancements involve enhancing ICE by modifying the decoding strategy, obviating the need for altering internal model structures or adjusting external prompts. However, this enhancement operates across the entire sequence generation, encompassing a plethora of non-critical tokens. In this work, we introduce $\textbf{A}$daptive $\textbf{T}$oken $\textbf{Bias}$er ($\textbf{ATBias}$), a new decoding technique designed to enhance ICE. It focuses on the tokens that are mostly related to knowledge during decoding, biasing their logits by matching key entities related to new and parametric knowledge. Experimental results show that ATBias significantly enhances ICE performance, achieving up to a 32.3% improvement over state-of-the-art ICE methods while incurring only half the latency. ATBias not only improves the knowledge editing capabilities of ICE but can also be widely applied to LLMs with negligible cost.
1 Introduction
ATBIAS enhances in-context editing by biasing logits for tokens matched to key knowledge entities rather than modifying the entire generated sequence. The paper reports improved editing performance with lower latency than state-of-the-art decoding methods.
1 Introduction
- LLM facts can become outdated and retraining is costly; stubborn knowledge is challenging to edit through context prompts, motivating decoding-based approaches.ICE provides contextual prompts with new knowledge, while DeCK modifies the entire generating sequence and carries potential inference-error and latency costs.Source: §1 · p. 1
- ATBIAS matches key entities and biases specific token logits, focusing on knowledge-related tokens rather than changing the entire generated sequence.It increases the generation probability of tokens related to new knowledge while decreasing that of parametric knowledge.Source: §1 · pp. 1–2
- ATBIAS extracts entities from new and parametric facts and uses offline knowledge caching to support editing with a single inference.The paper also describes probabilistic-ranking filtering of top-ranked, high-probability tokens to reduce implausible logit amplification and improve time efficiency.Source: §1 · p. 2
- Because tokenization makes key-entity tokens difficult to locate precisely, the paper develops an n-gram and Jaccard-based similarity algorithm for matching.The supplied description introduces this matching method but does not provide further details about its operation.Source: §1 · p. 2
- Up to a 32.3% improvement over state-of-the-art decoding methods with only half the latency is reported for ATBIAS.The authors attribute its advantage over DeCK in part to operating on a small number of key tokens rather than the entire sequence.Source: §1 · p. 2
2 Preliminary
The preliminary section describes next-token generation during decoding and defines multi-hop editing as updating both a target fact and related knowledge affected by its relations.
2 Preliminary
- At each decoding step, an LLM predicts a distribution over the vocabulary and samples the next token conditioned on the preceding tokens.Generation continues until an end-of-sequence token is produced.Source: §2 · p. 2
- Multi-hop editing tests whether an edit updates not only the target fact but also related knowledge within affected relations.The example combines a changed authorship fact with Richard Dawkins’s existing British nationality to yield “United Kingdom” for the two-hop question.Source: §2 · p. 3
- In the example, changing the author of “Misery” from Stephen King to Richard Dawkins changes the two-hop answer from “United States” to “United Kingdom.”The example uses Richard Dawkins’s existing British nationality as the related fact.Source: §2 · p. 3
3 Methods
ATBIAS induces parametric facts from new facts, extracts their entities, filters candidate tokens, matches them to entities, and adaptively biases logits. Its pipeline can cache induction and extraction for online retrieval.
3.1 Parametric Induction & Entity Extraction
- Cloze prompts elicit the model’s parametric fact corresponding to each new fact, after which entities from both facts are extracted for matching.For example, clozing “The author _ wrote ‘Misery’” elicits “The author Stephen King wrote ‘Misery’” for the new fact about Richard Dawkins.Source: §3.1 · p. 3
3.2 Probabilistic-Ranking Filter
- A probability-and-rank filter restricts matching to credible top-ranked tokens, avoiding low-credibility candidates and an overly large set of high-probability tokens.The filter combines a probability threshold relative to the maximum with a top-k ranking constraint.Source: §3.2 · p. 3
3.3 N-gram and Jaccard Similarity
- Because tokenization can split entity names, ATBIAS matches decoded token substrings to full entity strings using character n-grams and Jaccard similarity.The method compares n-gram sets for the decoded strings and entity strings, including prefixes, infixes, and suffixes.Source: §3.3 · pp. 3–4
3.4 Adaptive Token Biaser
- ATBIAS uses similarity to bias logits for key-entity tokens, increasing new-knowledge tokens and decreasing parametric-knowledge tokens without biasing most other tokens.The authors state that focusing on crucial tokens rather than the full sequence reduces the potential risk of introducing inappropriate tokens during decoding.Source: §3.4 · pp. 4–5
3.5 Knowledge Caching for Efficient Editing
- ATBIAS can preprocess parametric-fact induction and entity extraction when an edit-memory fact is updated, then retrieve cached entities during inference.The paper also describes an online extraction option when ICE methods already elicit parametric outputs, requiring a single inference with negligible additional overhead.Source: §3.5 · p. 5
4 Experiments
Experiments evaluate ATBIAS across multi-hop, one-hop, and stubborn-knowledge editing, as well as latency and token-probability analyses. ATBIAS-enhanced ICE is reported to improve editing performance, with an improvement of up to 32.3% over DeCK.
4.1 Experimental Setup
- Experiments cover multi-hop MQUAKE datasets, one-hop COUNTERFACT, several LLM families, and ICE and model-editing baselines.The setup also includes STUBBORN datasets for stubborn-knowledge evaluation and uses batch size 1 for the edit memory in one setup.Source: §4.1 · p. 5
4.2 Overall Performance
- In full-batch multi-hop editing experiments on 500 instances, ATBIAS enhanced MeLLo to varying degrees, with an improvement of up to 32.3% compared with DeCK.Source: Table 2 · p. 6, §4.2 · p. 6
4.3 One-hop Editing
- ATBIAS-enhanced IKE consistently outperforms other methods on the COUNTERFACT one-hop editing task.The supplied passage reports high accuracy for IKE on this simpler one-hop task but gives no specific accuracy values.Source: Table 3 · p. 6, §4.3 · p. 6
4.4 Editing on Stubborn Knowledge
- On STUBBORN datasets, IKE’s performance significantly declined compared with Table 1 and fell below ROME; decoding enhancements significantly improved editing, with ATBIAS consistently achieving the best performance.IKE methods used edit-memory batch size 1. STUBBORN > 33% and > 67% mark MQUAKE-3K instances where IKE failed to edit knowledge more than those respective proportions of the time.Source: §4.4 · p. 7, Table 4 · p. 7
4.5 Latency & Throughput
- ATBIAS raises LLAMA2-7B-CHAT decoding time by only 1.01 times baseline, while DeCK requires approximately 2x baseline latency.The paper attributes ATBIAS's efficiency to a probabilistic-ranking filter that excludes most low-probability tokens.Source: Table 5 · p. 7, §4.5 · p. 7
4.6 Why ATBIAS Edits Efficiently?
- With ATBIAS, new-knowledge entities shift toward higher probabilities and rankings, while parametric-knowledge probabilities show the opposite trend.The analysis records normalized logits for first tokens representing new and parametric knowledge entities.Source: §4.6 · p. 7, Figure 3 · p. 8
4.7 Ablation Study
- The ablation study examines adaptive constraints, bias coefficients, and components; its filter results support using both probability and ranking constraints.Table 6 presents the filter results; additional ablations are reported in Appendix B.Source: §4.7 · p. 8, Table 6 · p. 8
5 Related Work
Related work situates knowledge editing among parameter editing, meta-learning, and in-context approaches, and describes decoding strategies that alter logits during generation. ATBIAS is distinguished by focusing its adjustments on key tokens.
Knowledge Editing
- Knowledge editing includes parameter-changing model editing, hypernetwork-based meta-learning, and in-context editing using edited facts and retrieved demonstrations.The passage cites model-editing works (Zhu et al., 2020; Meng et al., 2022a,b; Huang et al., 2023b), meta-learning works (De Cao et al., 2021; Mitchell et al., 2021), and ICE works (Mitchell et al., 2022; Madaan et al., 2022; Zhong et al., 2023; Zheng et al., 2023).Source: §5 · p. 8
Decoding Strategy
- Decoding strategies modify token logits during generation; CD, DoLa, ICD, and DeCK use different model or output contrasts.CD compares expert and amateur language models [Li et al., 2023]; DoLa contrasts mature and premature layers [Chuang et al., 2023]; ICD compares against hallucination-injected models [Zhang et al., 2023a]; DeCK contrasts new-knowledge and parametric-knowledge probability increments [Bi et al., 2024a].Source: §5 · p. 8
- Unlike the described decoding methods, ATBIAS adjusts key tokens to enhance knowledge editing and mitigate factual hallucinations.The passage defines factual hallucinations as content that deviates from established world knowledge and identifies outdated knowledge as a major contributing factor.Source: §5 · p. 8
6 Conclusion
ATBIAS enhances ICE by biasing knowledge-relevant tokens, improving editing success while keeping latency close to the base model.
6 Conclusion
- ATBIAS significantly improves ICE editing success and outperforms current best decoding methods.Its token-focused design also reduces the potential risk of errors in the logical coherence of generated statements.Source: §6 · p. 8
- ATBIAS biases logits for crucial knowledge-related tokens by matching knowledge entities.Source: §6 · p. 8
- Latency is at most 1.01 times that of the baseline, supporting deployment at negligible cost.Source: §6 · pp. 8–9
Limitations
The evaluation covers three LLMs and two representative ICE methods; efficacy beyond these settings remains less explored.
Limitations
- The evaluation focuses on LLAMA2-7B-CHAT, LLAMA2-13B-CHAT, and MISTRAL-7B-INSTRUCT.Source: Limitations · p. 9
- ATBIAS’s efficacy on other LLMs remains less explored.Source: Limitations · p. 9
- Evaluation of ATBIAS is limited to the representative ICE methods IKE and MeLLo, leaving broader validation for future work.Source: Limitations · p. 9
Ethical Considerations
The paper describes its ethical choices and shows how ATBIAS can be deployed with MeLLo using parametric answers to subquestions.
Ethical Considerations
- The work uses open-source datasets and open-source or widely recognized models, and measures knowledge updates with public counterfactual datasets.Source: Ethical Considerations · p. 9
- ATBIAS is designed to avoid producing harmful or misleading information, with transparency and responsible use named as priorities.Source: Ethical Considerations · p. 9
A How Can ATBIAS Be Easily Deployed on MeLLo?
- Figure 4 illustrates MeLLo deployment: parametric subquestion answers supply entities online, avoiding offline preprocessing and requiring only a single inference.Source: Figure 4 · p. 11, A How Can ATBIAS Be Easily Deployed on… · p. 11
B Additional Ablation Study of ATBIAS
The additional ablation study uses IKE with two LLAMA2 chat models on MQUAKE-3K.
B Additional Ablation Study of ATBIAS
- The additional ablation experiments use IKE with LLAMA2-7B-CHAT and LLAMA2-13B-CHAT.Source: B Additional Ablation Study of ATBIAS · p. 11
- The study examines ATBIAS with IKE rather than reporting an additional result in the supplied passage.Source: B Additional Ablation Study of ATBIAS · p. 11
- MQUAKE-3K is the dataset used for these additional experiments.Source: B Additional Ablation Study of ATBIAS · p. 11
B.1 N-gram Decomposition
The ablations identify settings for n-gram decomposition and the filter’s probabilistic and ranking constraints that yield the best reported editing performance.
B.1 N-gram Decomposition
- n = 2 yields the best editing performance; excessively high or low decomposition precision diminishes matching effectiveness.N-gram decomposition is a prerequisite for calculating similarity between knowledge entities and filtered tokens.Source: §B.1 · p. 11, Figure 5 · p. 11
B.2 Probabilistic Constraint of Filter
- α = 0.0005 yields the best editing performance; smaller α values indicate stricter filtering that prevents interference from unreasonable tokens.Source: §B.2 · p. 11, Figure 6 · p. 11
B.3 Ranking Constraint of Filter
- k = 10 yields the best editing performance in the ranking-constraint ablation.Source: §B.3 · p. 11, Figure 7 · p. 11
B.4 Bias Coefficient of Knowledge
The bias coefficients adjust logits for tokens matching new and parametric knowledge entities, with reported best settings of λn = 25 and λp = 1. ATBIAS can also enhance ICE without modifying prompts.
B.4 Bias Coefficient of Knowledge
- λn = 25 and λp = 1 yield the best performance; excessively large λp can suppress incorrectly matched old-knowledge entities too strongly and hurt editing.Source: §B.4 · p. 12, Table 9 · p. 12, Table 10 · p. 12
C Prompts of ICE for Experiments
- ATBIAS enhances the IKE and MeLLo ICE methods without modifying their prompts.Source: C Prompts of ICE for Experiments · p. 13