lexve / README.md
aadityabuilds's picture
LexVE v2 release: default + graded_distance configs, dataset card, provenance
932f2eb verified
|
Raw History Blame Contribute Delete
20 kB
metadata
license: cc-by-4.0
language:
  - en
pretty_name: LexVE
size_categories:
  - 1K<n<10K
task_categories:
  - text-classification
tags:
  - minimal-pairs
  - interpretability
  - mechanistic-interpretability
  - linguistics
  - value-embeddings
  - causal-intervention
configs:
  - config_name: default
    default: true
    data_files:
      - split: discovery
        path: data/default/discovery.parquet
      - split: evaluation
        path: data/default/evaluation.parquet
  - config_name: graded_distance
    data_files:
      - split: discovery
        path: data/graded_distance/discovery.parquet
      - split: evaluation
        path: data/graded_distance/evaluation.parquet
dataset_info:
  - config_name: default
    features:
      - name: anchor
        dtype: string
      - name: base_class
        dtype: string
      - name: base_label
        dtype: string
      - name: base_label_id
        dtype: int64
      - name: base_text
        dtype: string
      - name: base_token_id
        dtype: int64
      - name: base_word
        dtype: string
      - name: calibration_status
        dtype: string
      - name: class_labels
        dtype: bool
      - name: cluster_id
        dtype: string
      - name: cue_gap
        dtype: int64
      - name: direction
        dtype: string
      - name: frame
        dtype: string
      - name: id
        dtype: string
      - name: linguistic_level
        dtype: string
      - name: pair_id
        dtype: string
      - name: pair_index
        dtype: int64
      - name: pos_tag
        dtype: string
      - name: schema_version
        dtype: string
      - name: source_class
        dtype: string
      - name: source_label
        dtype: string
      - name: source_label_id
        dtype: int64
      - name: source_text
        dtype: string
      - name: source_token_id
        dtype: int64
      - name: source_word
        dtype: string
      - name: split
        dtype: string
      - name: swap_pos
        dtype: int64
      - name: task
        dtype: string
      - name: template_id
        dtype: string
      - name: template_text
        dtype: string
      - name: tier
        dtype: string
      - name: token_count
        dtype: int64
      - name: known_issue
        dtype: bool
      - name: known_issue_note
        dtype: string
    splits:
      - name: discovery
        num_examples: 1376
        num_bytes: 64340
      - name: evaluation
        num_examples: 1294
        num_bytes: 62310
  - config_name: graded_distance
    features:
      - name: base_class
        dtype: string
      - name: base_label
        dtype: string
      - name: base_label_id
        dtype: int64
      - name: base_text
        dtype: string
      - name: base_token_id
        dtype: int64
      - name: base_word
        dtype: string
      - name: class_labels
        dtype: bool
      - name: cluster_id
        dtype: string
      - name: cue_gap
        dtype: int64
      - name: direction
        dtype: string
      - name: filler_tokens
        dtype: int64
      - name: frame
        dtype: string
      - name: id
        dtype: string
      - name: linguistic_level
        dtype: string
      - name: pair_id
        dtype: string
      - name: pair_index
        dtype: int64
      - name: pos_tag
        dtype: string
      - name: schema_version
        dtype: string
      - name: source_class
        dtype: string
      - name: source_label
        dtype: string
      - name: source_label_id
        dtype: int64
      - name: source_text
        dtype: string
      - name: source_token_id
        dtype: int64
      - name: source_word
        dtype: string
      - name: split
        dtype: string
      - name: swap_pos
        dtype: int64
      - name: task
        dtype: string
      - name: template_id
        dtype: string
      - name: template_text
        dtype: string
      - name: tier
        dtype: string
      - name: token_count
        dtype: int64
      - name: known_issue
        dtype: bool
      - name: known_issue_note
        dtype: string
    splits:
      - name: discovery
        num_examples: 1120
        num_bytes: 46034
      - name: evaluation
        num_examples: 1070
        num_bytes: 44251

LexVE: lexical minimal pairs for word-level interventions

LexVE is a set of 2,670 English minimal-pair prompts across 38 tasks. In each pair the two prompts differ in exactly one word (the cue), and that word decides the next token. It was built to study how language models use a single word's identity, for example by swapping or steering that word's embedding or value-embedding vectors, and it works as a plain minimal-pair benchmark too.

from datasets import load_dataset

ds = load_dataset("aadityabuilds/lexve")                       # LexVE v2: splits "discovery", "evaluation"
graded = load_dataset("aadityabuilds/lexve", "graded_distance")  # cue-to-prediction distance 0-14 tokens
row = ds["evaluation"][0]

Example row (animacy_relative):

prompt cue expected next token
base We finally met the doctor, doctor (human) " who"
source We finally met the statue, statue (inanimate) " which"

A model that has learned the distinction should prefer " who" after the base prompt and " which" after the source prompt. An intervention on the cue (e.g. replacing the doctor's vector with the statue's) should move the prediction from " who" toward " which".

Configurations

Config Rows Discovery / evaluation What it is
default 2,670 1,376 / 1,294 LexVE v2: 38 tasks, near / far / attractor frames
graded_distance 2,190 1,120 / 1,070 19 tasks; one fixed stem per task with filler phrases so the cue sits 0, 4, 7, 10 or 14 tokens before the prediction

Both configs reuse the same lexical pairs and the same discovery/evaluation assignment.

Tasks

The 38 tasks cover cues of 13 parts of speech and eight linguistic levels.

Task Level Cue POS Tier Status Labels (class A / B) Pairs Rows Graded rows Example (base → label)
adj_prep_of_with lexicalized_syntax adjective open capable of / with 17 136 170 Everyone knew she was afraid → of (vs satisfied → with)
adj_prep_to_from lexicalized_syntax adjective open capable to / from 17 136 170 Everyone knew she was similar → to (vs different → from)
animacy_relative lexical_semantics noun open capable who / which 20 160 – We finally met the doctor, → who (vs statue → which)
article_phonology phonology article diag limited apple / banana 1 8 – For breakfast, I ate an → apple (vs a → banana)
comparative_than morphology adjective open capable than / and 18 144 180 The new house is bigger → than (vs big → and)
complement_clause lexicalized_syntax verb open capable whether / that 16 128 160 In the interview, the journalist wondered → whether (vs claimed → that)
container_noun lexical_semantics noun closed capable water / paper 5 40 – She handed me a bottle of → water (vs pile → paper)
correlative morphosyntax conjunction diag capable or / nor 1 12 – You can choose either the red one → or (vs neither → nor)
country_language world_knowledge proper_noun open capable pair-specific 11 88 110 In France, most people speak → French (vs Spain → Spanish)
dative_alternation lexicalized_syntax verb open limited me / the 16 32 – Two days ago, my neighbor gave → me (vs donated → the)
determiner_number morphosyntax determiner closed capable is / are 8 96 80 The farmer told us that this sheep → is (vs these → are)
entity_type lexical_semantics proper_noun open capable who / where 20 120 – The article mentioned John, → who (vs London → where)
food_selection lexical_semantics verb diag capable water / bread 6 36 – Every morning, my grandmother drank some → water (vs ate → bread)
gender_pronoun lexical_semantics noun open capable he / she 11 110 110 The man said that → he (vs woman → she)
gerund_vs_infinitive lexicalized_syntax verb open capable going / to 8 64 80 Last year, she enjoyed → going (vs wanted → to)
hypernym_class lexical_semantics noun closed capable bird / fish 8 64 80 A eagle is a kind of → bird (vs shark → fish) †
infinitive_vs_object lexicalized_syntax verb open capable to / the 16 96 160 After a long day, Maria decided → to (vs enjoyed → the)
irregular_number morphosyntax noun open capable was / were 16 160 160 I think the man → was (vs men → were)
light_verb collocation verb diag limited decision / walk 1 10 – Tomorrow I will make a → decision (vs take → walk)
mass_count morphosyntax quantifier closed capable money / friends 4 20 – To be honest, I do not have much → money (vs many → friends)
modal_bare_vs_to morphosyntax modal closed capable be / to 9 72 90 Honestly, we should → be (vs ought → to)
noun_prep_for_in lexicalized_syntax noun open capable for / in 16 96 160 The report highlighted the need → for (vs increase → in)
noun_prep_on_to lexicalized_syntax noun open capable on / to 15 90 150 They discussed the impact → on (vs access → to)
npi_licensing semantics quantifier_adverb closed capable any / some 7 40 – At the party, nobody had → any (vs somebody → some)
numeral_noun_number morphosyntax determiner closed capable year / years 7 56 – The project took one → year (vs three → years)
particle_up_out collocation verb open capable up / out 11 88 – After a while, she gave → up (vs figured → out)
partitive_agreement morphosyntax quantifier closed capable is / are 6 48 – I think one of the boxes → is (vs two → are)
prep_government_mixed lexicalized_syntax verb open capable pair-specific 9 72 90 At the time, Alex relied → on (vs looked → at)
pronoun_case morphosyntax preposition_vs_subordinator closed limited him / he 8 16 – They stayed in the room with → him (vs because → he)
range_preposition lexicalized_syntax preposition diag capable to / and 1 12 – Prices range from ten → to (vs between → and)
sensory_modality lexical_semantics adjective closed capable sound / light 7 42 – Suddenly there was a loud → sound (vs bright → light)
temporal_tense semantics adverb closed capable will / was 5 30 40 The coach said that tomorrow the team → will (vs yesterday → was)
time_place_relative lexical_semantics noun open capable when / where 11 66 – I still remember the day → when (vs city → where)
transitivity lexicalized_syntax verb open capable the / . 15 90 – A moment later, Maya inspected → the (vs arrived → .)
unit_ago_away lexical_semantics noun closed capable ago / away 4 32 – That was only a few weeks → ago (vs miles → away)
verb_prep_from_of lexicalized_syntax verb closed capable from / of 6 48 60 In the end, she suffered → from (vs consisted → of)
verb_prep_in_with lexicalized_syntax verb closed capable in / with 6 48 60 In the end, she participated → in (vs dealt → with)
verb_prep_on_to lexicalized_syntax verb open capable on / to 8 64 80 In the end, she focused → on (vs referred → to)

† This example is one of the flagged ungrammatical rows (see Limitations).

Fields

Field Description
id Unique row id: v2__<task>__p<pair>__<template>__<direction> (graded: g__<task>__p<pair>__d<distance>__<direction>).
task Task name (38 in default, 19 in graded_distance).
base_text Prompt with the base cue word. The model is asked for the next token.
source_text The same prompt with the cue word swapped for its partner (the only difference).
base_word, source_word The cue word in each prompt (no leading space).
base_label, source_label Expected next token after each prompt, as a string with its leading space (e.g. " who").
base_class, source_class Class of each cue word (e.g. human / inanimate).
class_labels True if labels are shared by the whole class (36 of 38 tasks); False if each pair has its own labels (country_language, prep_government_mixed).
direction a_to_b or b_to_a. Every pair appears in both directions (base and source exchanged).
pair_id, cluster_id Lexical pair, e.g. animacy_relative::doctor__statue. Use cluster_id to group rows for cluster bootstraps.
pair_index Index of the pair within its task; even = discovery, odd = evaluation (see Splits).
split discovery or evaluation (also the HF split name).
template_id, template_text Sentence template; {w} marks the cue slot.
frame near (cue within two tokens of the prediction), far (neutral words in between), attractor (agreement attraction). Graded: graded_d0 ... graded_d14.
tier open (8 or more lexical pairs), closed (function-word cues, few possible pairs), diag (a single lexeme pair; clusters are templates). Tiers should not be pooled.
linguistic_level One of eight levels: lexical_semantics, world_knowledge, morphology, morphosyntax, lexicalized_syntax, collocation, semantics, phonology.
pos_tag Part of speech of the cue word.
anchor (default only) Literature that inspired the task (inspiration only; no text is copied).
calibration_status (default only) capable or limited: whether the d12/d16/d20 nanochat models passed the discovery-pair baseline rule for this task (see Construction).
filler_tokens (graded_distance only) Number of filler tokens inserted between cue and prediction: 0, 4, 7, 10 or 14.
schema_version lexve-v2.0 or lexve-v2.0-graded.
known_issue, known_issue_note True for rows whose text has "a" before a vowel-initial word (e.g. "A eagle is a kind of"); kept unchanged, see Limitations.
*_token_id, *_label_id, swap_pos, token_count, cue_gap Tokenizer-specific (nanochat BPE, see below): token ids of the cue and label, cue token position, prompt length in tokens, and tokens between cue and prediction.

Model-agnostic vs tokenizer-specific. Every text, word, label-string, class, task and metadata field is model-agnostic. The token-id and position fields refer to the nanochat BPE tokenizer (Karpathy's nanochat, MIT license; tokenizer tokenizer.pkl sha256 387cfc082b0bee45467774fd6f1310a922ad170886a58ccddcb468f275e06a6c). With another tokenizer, re-tokenize base_text / source_text and the labels. Cue words and labels were chosen to be single tokens with a leading space under nanochat, so some may split into several tokens elsewhere.

Splits

  • discovery and evaluation are assigned by lexical pair: even pair_index → discovery, odd → evaluation. Exceptions: article_phonology splits by template and food_selection by lexeme.
  • Within a task (excluding diag tier), no cue word appears in both splits, so held-out results test generalization to new words.
  • Use discovery to choose anything (heads, directions, hyperparameters) and report on evaluation.
  • Each pair appears in both directions (a_to_b, b_to_a). For confidence intervals, resample by cluster_id, not by row.

Construction

  • Hand-written. Class word lists, pairings and sentence templates were written by hand (specs_v2.py). Cross-class pairs were matched roughly by corpus frequency. No row was generated by a language model. Pairs were never selected or dropped based on any model's intervention results.
  • Tokenizer screen. Every cue and label had to be a single nanochat token with a leading space and to align in every template. Pairs that failed BPE alignment were rejected (listed in provenance/manifest_*.json).
  • Template calibration (baseline only, discovery pairs only). Templates were kept if, averaged over three nanochat models (d12, d16, d20 with value embeddings), at least 50% of discovery pairs were predicted correctly in both directions and the two labels held at least 2% of probability mass. Evaluation pairs never influenced selection. Tasks with fewer than two surviving near templates are kept and marked calibration_status: limited. The per-template numbers are in provenance/template_selection.json, and baseline accuracy and label mass per task and model are in provenance/baseline_competence.json.
  • Graded distance. Uses the same pairs with one stem per task plus fixed filler phrases (", it seems,", ", as far as we know,", ...). The stems and fillers are in provenance/manifest_graded.json.
  • Inspirations, not sources. Task designs draw on CausalGym, BLiMP, RAVEL, COMPS, Ettinger (2020), Warstadt et al. (2019) and Chierchia (1998) (field anchor). No text was copied from these resources.

Limitations

  • Ungrammatical article rows. 22 rows in default (11 distinct texts) and 30 rows in graded_distance (15 texts) put "a" before a vowel-initial word: "A eagle / eel / owl is a kind of" (hypernym_class), "a aircraft" (determiner_number), "a audible" (sensory_modality). They are kept unchanged so the data match published results, and flagged with known_issue. Filter them out with ds.filter(lambda r: not r["known_issue"]).
  • Calibration circularity. Templates were chosen using baselines of the same nanochat models the dataset was first used to analyse (discovery pairs only). Results on other models do not inherit this bias, but results on those three models should be read with it in mind.
  • Small tasks. Four diag tasks have a single lexical pair (article_phonology, correlative, light_verb, range_preposition); their clusters are templates. Several closed tasks have only 4-9 pairs.
  • Weak baselines. Four tasks are limited (article_phonology, dative_alternation, light_verb, pronoun_case). In the calibration models, label mass is low for some tasks (pronoun_case about 2%, article_phonology 1-2%, light_verb 3-5%).
  • Cue reuse. Some cue words appear in more than one task (e.g. "actor").
  • Scope. English only. Gender pairs are binary (masculine/feminine nouns). Labels are a single next token, so this is a two-way forced choice, not a test of fluent generation.

Provenance and integrity

The Parquet files are a lossless conversion of the frozen JSONL files plus the two known_issue columns, verified value by value. The source hashes are:

Config Source file sha256
default lexve_v2.jsonl 3b8a30a8f989a900026bfaf0c480a7e00a516a400270db6b2c79db94b7d957e2
graded_distance lexve_v2_graded.jsonl 72028c0b5fdc7067f568722b25c0d39c549d598be3af9011891d9a592fcff6b9

SHA256SUMS covers every file in this repository.

License

CC BY 4.0.

Citation

@misc{lexve2026,
  title  = {LexVE: Lexical Minimal Pairs for Word-Level Interventions},
  author = {AUTHORS_TBD},
  year   = {2026},
  howpublished = {\url{https://huggingface.co/datasets/aadityabuilds/lexve}}
}