SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.10091 · 2023

Look Before You Leap: A Universal Emergent Decomposition of Retrieval Tasks in Language Models

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 11 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
avariengien/causal-checker canonical 5 of 11
FunctionStatusWhere it lives
find_prompt Ran avariengien/causal-checker/causal_checker/datasets/factual_recall.py
pointer only (licence: NONE) · get_code("2509c1b84bf7d48d")
gen_random_str Ran avariengien/causal-checker/causal_checker/datasets/induction_dataset.py
pointer only (licence: NONE) · get_code("ea05eda2bcf6b27c")
get_attn Ran avariengien/causal-checker/causal_checker/hf_hooks.py
pointer only (licence: NONE) · get_code("baae3c546f956892")
get_first_token Ran avariengien/causal-checker/causal_checker/utils.py
pointer only (licence: NONE) · get_code("9f2b9aa60203187f")
get_first_token_id Ran avariengien/causal-checker/causal_checker/utils.py
pointer only (licence: NONE) · get_code("dcd4df1a51bc9e53")
get_blocks Not yet run avariengien/causal-checker/causal_checker/hf_hooks.py
pointer only (licence: NONE) · get_code("d3f2feed3a20048f")
get_falcon_model Not yet run avariengien/causal-checker/causal_checker/models.py
pointer only (licence: NONE) · get_code("6f165b1d25044b40")
get_gpt2_model Not yet run avariengien/causal-checker/causal_checker/models.py
pointer only (licence: NONE) · get_code("98344cd8557cd026")
get_mlp Not yet run avariengien/causal-checker/causal_checker/hf_hooks.py
pointer only (licence: NONE) · get_code("663c7c980830dae7")
get_model Not yet run avariengien/causal-checker/causal_checker/models.py
pointer only (licence: NONE) · get_code("db7a6ad9e7d90dd3")
read_json Not yet run avariengien/causal-checker/causal_checker/datasets/factual_recall.py
pointer only (licence: NONE) · get_code("04716e8e8ec93bf1")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

When solving challenging problems, language models (LMs) are able to identify relevant information from long and complicated contexts. To study how LMs solve retrieval tasks in diverse situations, we introduce ORION, a collection of structured retrieval tasks spanning six domains, from text understanding to coding. Each task in ORION can be represented abstractly by a request (e.g. a question) that retrieves an attribute (e.g. the character name) from a context (e.g. a story). We apply causal analysis on 18 open-source language models with sizes ranging from 125 million to 70 billion parameters. We find that LMs internally decompose retrieval tasks in a modular way: middle layers at the last token position process the request, while late layers retrieve the correct entity from the context. After causally enforcing this decomposition, models are still able to solve the original task, preserving 70% of the original correct token probability in 98 of the 106 studied model-task pairs. We connect our macroscopic decomposition with a microscopic description by performing a fine-grained case study of a question-answering task on Pythia-2.8b. Building on our high-level understanding, we demonstrate a proof of concept application for scalable internal oversight of LMs to mitigate prompt-injection while requiring human supervision on only a single input. Our solution improves accuracy drastically (from 15.5% to 97.5% on Pythia-12b). This work presents evidence of a universal emergent modular processing of tasks across varied domains and models and is a pioneering effort in applying interpretability for scalable internal oversight of LMs.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2312.10091")
get_code_for_paper("2312.10091")
have("2312.10091")

Connect an agent — have() is free.