{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2606-21876","title":"Protein contacts are already in the attention: a single-forward-pass alternative to the Categorical Jacobian","arxiv_id":"2606.21876","date":"2026-06-20","proceeding":null,"authors":["Rome Thorstenson"],"abstract":"The Categorical Jacobian of Zhang et al. (2024) reads protein contacts from a language model by perturbing every residue with every alternative amino acid, about $19L$ forward passes. We show the signal it reconstructs is already concentrated in a small subset of attention heads: averaging the top-$K$ contact-relevant heads -- selected on as few as 10 labeled proteins, with no fitted per-pair or per-head weights -- recovers contacts in a single forward pass and matches or beats the Categorical Jacobian for every bidirectional model where it is defined (bar the smallest, 8M). Our primary test is leakage-clean: on a CAMEO split where neither selection nor evaluation touches data the models have plausibly memorized, the head readout beats the Categorical Jacobian on ESM-2-650M by +9pp ($N = 29$, $p < 0.001$), with the within-model margin reproducing across architectures. Ablations localize the gain to labeled head selection, not to averaging: at a matched label budget the unweighted mean ties a supervised $L_1$ logistic regression on the same heads. Both methods fall 30-36pp from their in-distribution Zhang numbers to the leakage-clean split, which we read as an upper bound on how much prior numbers reflect pretraining overlap. We additionally introduce representation-CJ, a hidden-state generalization of the Jacobian to architectures without a masked-LM head (the output-head-independent analogue of logit-CJ), agreeing with the Categorical Jacobian where both are defined (per-protein Pearson $r \\approx 0.95$); show that the optimal $K$ tracks how diffusely a model spreads its contact heads; and find both methods lose the signal on the two causal LMs we test, suggesting attention-encoded pair structure may depend on bidirectional pretraining.","url_abs":"https://arxiv.org/abs/2606.21876","url_pdf":"https://arxiv.org/pdf/2606.21876","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2606.21876","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2606.21876"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/Rome-1/plm-contact-fusion","reach":null}],"summary":{"ran":3,"ran_fixture":1,"ran_honours":1,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"found_in_text":{"samples":7,"ran":6,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"173129b49ec549b1","entry":"ReprCJConfig","repo":"Rome-1/plm-contact-fusion","repo_kind":"found_in_text","path":"src/baselines/representation_cj.py","file_url":"https://github.com/Rome-1/plm-contact-fusion/blob/HEAD/src/baselines/representation_cj.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"173129b49ec549b1"}},{"code_sha256_prefix":"d18b3a5f08dce634","entry":"ReprCJDistance","repo":"Rome-1/plm-contact-fusion","repo_kind":"found_in_text","path":"src/baselines/representation_cj.py","file_url":"https://github.com/Rome-1/plm-contact-fusion/blob/HEAD/src/baselines/representation_cj.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d18b3a5f08dce634"}},{"code_sha256_prefix":"9e372c5b3a145890","entry":"ReprCJResult","repo":"Rome-1/plm-contact-fusion","repo_kind":"found_in_text","path":"src/baselines/representation_cj.py","file_url":"https://github.com/Rome-1/plm-contact-fusion/blob/HEAD/src/baselines/representation_cj.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9e372c5b3a145890"}},{"code_sha256_prefix":"a86bf64058776a13","entry":"_distance","repo":"Rome-1/plm-contact-fusion","repo_kind":"found_in_text","path":"src/baselines/representation_cj.py","file_url":"https://github.com/Rome-1/plm-contact-fusion/blob/HEAD/src/baselines/representation_cj.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a86bf64058776a13"}},{"code_sha256_prefix":"f6c6737aab13ba8b","entry":"apc_correction","repo":"Rome-1/plm-contact-fusion","repo_kind":"found_in_text","path":"src/baselines/representation_cj.py","file_url":"https://github.com/Rome-1/plm-contact-fusion/blob/HEAD/src/baselines/representation_cj.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f6c6737aab13ba8b"}},{"code_sha256_prefix":"3474184a9192c8e0","entry":"run_representation_cj","repo":"Rome-1/plm-contact-fusion","repo_kind":"found_in_text","path":"src/baselines/representation_cj.py","file_url":"https://github.com/Rome-1/plm-contact-fusion/blob/HEAD/src/baselines/representation_cj.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3474184a9192c8e0"}},{"code_sha256_prefix":"9cbb4897adde190f","entry":"ReprCJMode","repo":"Rome-1/plm-contact-fusion","repo_kind":"found_in_text","path":"src/baselines/representation_cj.py","file_url":"https://github.com/Rome-1/plm-contact-fusion/blob/HEAD/src/baselines/representation_cj.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9cbb4897adde190f"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}