This repository provides a lightweight reference implementation for the main interfaces used in adjoint-induced retrieval (AIR) experiments:
- retrieval operators for identity, Householder, and linear AIR readouts;
- cosine top-k and MRR retrieval metrics;
- JSONL data schema validation;
- a CPU-friendly toy inverse-retrieval sanity check.
The goal of this release is to make the method components and evaluation protocol easy to inspect, run, and adapt. Large model weights, checkpoints, and full-scale datasets are not bundled in this repository.
python -m venv .venv
source .venv/bin/activate
pip install -e .On Windows PowerShell:
py -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .Run a small synthetic inverse-retrieval sanity check:
python scripts/run_toy_air.py --operator linear --epochs 200Validate the example JSONL schema:
python scripts/validate_schema.py examples/toy_inverse.jsonlchiral_air/
data.py JSONL loading and schema validation.
metrics.py top-k and MRR retrieval metrics.
operators.py identity, Householder, and linear readout operators.
toy.py synthetic inverse-retrieval data generator.
scripts/
run_toy_air.py
validate_schema.py
docs/
data_schema.md
artifact_scope.md
examples/
toy_inverse.jsonl
If this code is useful for your work, please cite the associated ICML paper:
@inproceedings{du2026chiral,
title = {Chiral Symmetry Breaking in Transformers: A Group-Equivariant Framework for Solving the Reversal Curse via Adjoint Manifold Mappings},
author = {Du, Hanji},
booktitle = {Proceedings of the International Conference on Machine Learning},
year = {2026}
}For papers or project pages, a concise description of this release is provided
in docs/code_availability_statement.md.