Lune

ICLR2022Top-tier venue

Capturing Structural Locality in Non-parametric Language Models

Frank F. Xu, Junxian He, Graham Neubig, Vincent Josua Hellendoorn

Abstract

Structural locality is a ubiquitous feature of real-world datasets, wherein data points are organized into local hierarchies. Some examples include topical clusters in text or project hierarchies in source code repositories. In this paper, we explore utilizing this structural locality within non-parametric language models, which generate sequences that reference retrieved examples from an external source. We propose a simple yet effective approach for adding locality information into such models by adding learned parameters that improve the likelihood of retrieving examples from local neighborhoods. Experiments on two different domains, Java source code and Wikipedia text, demonstrate that locality features improve model efficacy over models without access to these features, with interesting differences. We also perform an analysis of how and where locality features contribute to improved performance and why the traditionally used contextual similarity metrics alone are not enough to grasp the locality structure.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

5 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Neuro-Symbolic Language Modeling with Automaton-augmented Retrieval cites Generalization through Memorization: Nearest Neighbor Language Models
  • CodePlan: Repository-Level Coding using LLMs and Planning cites Repository-Level Prompt Generation for Large Language Models of Code
  • CodePlan: Repository-Level Coding using LLMs and Planning cites Language Models are Few-Shot Learners
  • Monitor-Guided Decoding of Code LMs with Static Analysis of Repository Context cites Generalization through Memorization: Nearest Neighbor Language Models
  • Monitor-Guided Decoding of Code LMs with Static Analysis of Repository Context cites Repository-Level Prompt Generation for Large Language Models of Code
  • Monitor-Guided Decoding of Code LMs with Static Analysis of Repository Context cites Big code != big vocabulary: open-vocabulary models for source code
  • Repository-Level Prompt Generation for Large Language Models of Code cites Generalization through Memorization: Nearest Neighbor Language Models
  • Repository-Level Prompt Generation for Large Language Models of Code cites Language Models are Few-Shot Learners
  • Domain Adaptive Code Completion via Language Models and Decoupled Domain Databases cites Neuro-Symbolic Language Modeling with Automaton-augmented Retrieval
  • Domain Adaptive Code Completion via Language Models and Decoupled Domain Databases cites Generalization through Memorization: Nearest Neighbor Language Models
  • Extracting Training Data from Large Language Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Repository-Level Prompt Generation for Large Language Models of CodeDisha Shrivastava, Hugo Larochelle, Daniel TarlowICML 2023 · 184 citations
  2. Neuro-Symbolic Language Modeling with Automaton-augmented RetrievalUri Alon, Frank F. Xu, Junxian He, Sudipta Sengupta et al.ICML 2022 · 79 citations
  3. CodePlan: Repository-Level Coding using LLMs and PlanningRamakrishna Bairi, Atharv Sonwane, Aditya Kanade, Vageesh D. C. et al.FSE 2024 · 67 citations
  4. Monitor-Guided Decoding of Code LMs with Static Analysis of Repository ContextLakshya A. Agrawal, Aditya Kanade, Navin Goyal, Shuvendu K. Lahiri et al.NeurIPS 2023 · 55 citations
  5. Domain Adaptive Code Completion via Language Models and Decoupled Domain DatabasesZe Tang, Jidong Ge, Shangqing Liu, Tingwei Zhu et al.ASE 2023 · 29 citations

Builds on7

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
  3. Generalization through Memorization: Nearest Neighbor Language ModelsUrvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer et al.ICLR 2020 · 1,038 citations
  4. Big code != big vocabulary: open-vocabulary models for source codeRafael-Michael Karampatsis, Hlib Babii, Romain Robbes, Charles Sutton et al.ICSE 2020 · 140 citations
  5. Structural Language Models of CodeUri Alon, Roy Sadaka, Omer Levy, Eran YahavICML 2020 · 115 citations

Related papers

  1. GNN-LM: Language Modeling based on Global Contexts via GNNYuxian Meng, Shi Zong, Xiaoya Li, Xiaofei Sun et al.ICLR 2022 · 46 citations
  2. Why do Nearest Neighbor Language Models Work?Frank F. Xu, Uri Alon, Graham NeubigICML 2023 · 33 citations
  3. SSS: Editing Factual Knowledge in Language Models towards Semantic Sparse SpaceHuazheng Wang, Haifeng Sun, Jingyu Wang, Qi Qi et al.ACL Findings 2024
  4. Retrieve-and-Sample: Document-level Event Argument Extraction via Hybrid Retrieval AugmentationYubing Ren, Yanan Cao, Ping Guo, Fang Fang et al.ACL 2023 · 32 citations
  5. Adaptation Approaches for Nearest Neighbor Language ModelsRishabh Bhardwaj, George Polovets, Monica SunkaraACL Findings 2023 · 7 citations
Dusk over the sea between two cliffs drawn in fine vertical lines