{"paper":{"title":"NGM: A Plug-and-Play Training-Free Memory Module for LLMs","license":"http://arxiv.org/licenses/nonexclusive-distrib/1.0/","headline":"Averaging pretrained token embeddings creates n-gram representations that a cosine-gated injector adds to LLMs without training or extra parameters.","cross_cats":[],"primary_cat":"cs.AI","authors_text":"Caifeng Shan, Chenyang Si, Wenhui Dong, Yuwen Qu","submitted_at":"2026-05-16T09:12:52Z","abstract_excerpt":"Recent studies introduce conditional memory modules that decouple knowledge storage from neural computation, enabling more direct knowledge access. Compared to MoE, which relies on dynamic computation paths, explicit lookup provides a more efficient knowledge retrieval mechanism. However, these approaches still depend on learned memory embeddings, requiring additional training and limiting flexibility. To address this, we propose N-gram Memory (NGM), a training-free, plug-and-play module composed of a Causal N-Gram Encoder and a Cosine-Gated Memory Injector. The Causal N-Gram Encoder directly "},"claims":{"count":4,"items":[{"kind":"strongest_claim","text":"NGM improves average performance by 0.5 to 1.2 points, with particularly clear gains on code generation and knowledge-intensive tasks (e.g., +3.0 on LiveCodeBench and +3.03 on GPQA for Qwen3-14B).","source":"verdict.strongest_claim","status":"machine_extracted","claim_id":"C1","attestation":"unclaimed"},{"kind":"weakest_assumption","text":"That directly averaging pretrained token embeddings produces useful n-gram representations that the cosine-gated injector can meaningfully modulate without introducing noise or requiring any learned parameters or additional training.","source":"verdict.weakest_assumption","status":"machine_extracted","claim_id":"C2","attestation":"unclaimed"},{"kind":"one_line_summary","text":"NGM is a plug-and-play n-gram memory module that encodes n-grams from pretrained embeddings and gates their injection to improve LLM performance by 0.5-1.2 points on average across eight benchmarks.","source":"verdict.one_line_summary","status":"machine_extracted","claim_id":"C3","attestation":"unclaimed"},{"kind":"headline","text":"Averaging pretrained token embeddings creates n-gram representations that a cosine-gated injector adds to LLMs without training or extra parameters.","source":"verdict.pith_extraction.headline","status":"machine_extracted","claim_id":"C4","attestation":"unclaimed"}],"snapshot_sha256":"6baecffb6c96d1935dbe25ba7f30ff9e38f2ccd80f94d5b2123a7b3572e0329f"},"source":{"id":"2605.16893","kind":"arxiv","version":1},"verdict":{"id":"653f6d5c-f8ff-469d-996e-09835f4516fc","model_set":{"reader":"grok-4.3"},"created_at":"2026-05-19T20:44:03.921359Z","strongest_claim":"NGM improves average performance by 0.5 to 1.2 points, with particularly clear gains on code generation and knowledge-intensive tasks (e.g., +3.0 on LiveCodeBench and +3.03 on GPQA for Qwen3-14B).","one_line_summary":"NGM is a plug-and-play n-gram memory module that encodes n-grams from pretrained embeddings and gates their injection to improve LLM performance by 0.5-1.2 points on average across eight benchmarks.","pipeline_version":"pith-pipeline@v0.9.0","weakest_assumption":"That directly averaging pretrained token embeddings produces useful n-gram representations that the cosine-gated injector can meaningfully modulate without introducing noise or requiring any learned parameters or additional training.","pith_extraction_headline":"Averaging pretrained token embeddings creates n-gram representations that a cosine-gated injector adds to LLMs without training or extra parameters."},"integrity":{"clean":true,"summary":{"advisory":0,"critical":0,"by_detector":{},"informational":0},"endpoint":"/pith/2605.16893/integrity.json","findings":[],"available":true,"detectors_run":[{"name":"doi_title_agreement","ran_at":"2026-05-19T21:01:19.186204Z","status":"completed","version":"1.0.0","findings_count":0},{"name":"cited_work_retraction","ran_at":"2026-05-19T20:52:41.515826Z","status":"completed","version":"1.0.0","findings_count":0},{"name":"doi_compliance","ran_at":"2026-05-19T20:51:11.023864Z","status":"completed","version":"1.0.0","findings_count":0},{"name":"claim_evidence","ran_at":"2026-05-19T18:41:56.281729Z","status":"completed","version":"1.0.0","findings_count":0},{"name":"ai_meta_artifact","ran_at":"2026-05-19T18:33:26.360270Z","status":"skipped","version":"1.0.0","findings_count":0}],"snapshot_sha256":"89957008473ad97c4417bfbd998e0cd5bb504fc49e8edf985592d4c361433c6e"},"references":{"count":44,"sample":[{"doi":"","year":2025,"title":"Qwen3-VL Technical Report","work_id":"1fe243aa-e3c0-4da6-b391-4cbcfc88d5c0","ref_index":1,"cited_arxiv_id":"2511.21631","is_internal_anchor":true},{"doi":"","year":2017,"title":"Enriching word vec- tors with subword information","work_id":"bed31a61-1767-406d-bf52-41211a3ba185","ref_index":2,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":2022,"title":"Improving language models by retrieving from trillions of tokens","work_id":"5fd45170-71b7-4233-a7e7-3c1f3c24ac46","ref_index":3,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":2007,"title":"Large language models in machine translation","work_id":"0dde0056-d211-4a75-bc5b-eb34faee6977","ref_index":4,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":2024,"title":"Are we on the right way for evaluating large vision- language models? Advances in Neural Information Processing Systems , 37:27056–27087, 2024","work_id":"9a68e153-fb33-47fe-b918-443ec4e86a5a","ref_index":5,"cited_arxiv_id":"","is_internal_anchor":false}],"resolved_work":44,"snapshot_sha256":"16a8bd943eba5ea19e5ca0767d5dbaef6e5182dd7e8a5f7cfd8a373eae45ca4e","internal_anchors":13},"formal_canon":{"evidence_count":2,"snapshot_sha256":"380d7b11e8eb1d92f2475716a211ee9061a2ef1158a5922871de50de6256fd8a"},"author_claims":{"count":0,"strong_count":0,"snapshot_sha256":"258153158e38e3291e3d48162225fcdb2d5a3ed65a07baac614ab91432fd4f57"},"builder_version":"pith-number-builder-2026-05-17-v1"}