{"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-2601-16644","title":"Sycophancy Hides Linearly in the Attention Heads","arxiv_id":"2601.16644","date":"2026-01-23","proceeding":null,"authors":["Rifo Genadi","Munachiso Nwadike","Nurdaulet Mukhituly","Hilal Alquabeh","Tatsuya Hiraoka","Kentaro Inui"],"abstract":"We find that correct-to-incorrect sycophancy signals are most linearly separable within multi-head attention activations. Motivated by the linear representation hypothesis, we train linear probes across the residual stream, multilayer perceptron (MLP), and attention layers to analyze where these signals emerge. Although separability appears in the residual stream and MLPs, steering using these probes is most effective in a sparse subset of middle-layer attention heads. Using TruthfulQA as the base dataset, we find that probes trained on it transfer effectively to other factual QA benchmarks. Furthermore, comparing our discovered direction to previously identified \"truthful\" directions reveals limited overlap, suggesting that factual accuracy, and deference resistance, arise from related but distinct mechanisms. Attention-pattern analysis further indicates that the influential heads attend disproportionately to expressions of user doubt, contributing to sycophantic shifts. Overall, these findings suggest that sycophancy can be mitigated through simple, targeted linear interventions that exploit the internal geometry of attention activations.","url_abs":"https://arxiv.org/abs/2601.16644","url_pdf":"https://arxiv.org/pdf/2601.16644","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=2601.16644","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2601.16644"}},"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/rifoagenadi/sycophancy","reach":null}],"summary":{"unverified":22},"by_repo_kind":{"found_in_text":{"samples":22,"ran":0,"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":22,"samples":[{"code_sha256_prefix":"a477a3f42afdd1e1","entry":"build_disagreement","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/dialogue.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/dialogue.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a477a3f42afdd1e1"}},{"code_sha256_prefix":"7c49870fa7c21780","entry":"build_steering_vectors_mha","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/steer.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/steer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7c49870fa7c21780"}},{"code_sha256_prefix":"9892ae07f0e6e3b4","entry":"build_steering_vectors_mlp","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/steer.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/steer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9892ae07f0e6e3b4"}},{"code_sha256_prefix":"62c385ad75991b3e","entry":"compute_metrics","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/metrics.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"62c385ad75991b3e"}},{"code_sha256_prefix":"0034fdf263dcf95e","entry":"detect_answer_columns","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/judge.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/judge.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0034fdf263dcf95e"}},{"code_sha256_prefix":"990b0732aa9dfd37","entry":"extract_mha","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/extract_activations.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/extract_activations.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"990b0732aa9dfd37"}},{"code_sha256_prefix":"965457182ce1219b","entry":"get_model_config","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/extract_activations.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/extract_activations.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"965457182ce1219b"}},{"code_sha256_prefix":"6187c7c6a5e4188a","entry":"get_probe_vectors","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"inference_mha.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/inference_mha.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6187c7c6a5e4188a"}},{"code_sha256_prefix":"47c669a4a7eaf353","entry":"get_probe_vectors","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"inference_mlp.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/inference_mlp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"47c669a4a7eaf353"}},{"code_sha256_prefix":"b107f49740772c27","entry":"get_probe_vectors","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"inference_residual.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/inference_residual.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b107f49740772c27"}},{"code_sha256_prefix":"7f62a2c5dd47982d","entry":"get_top_k_keys","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"inference_mha.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/inference_mha.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7f62a2c5dd47982d"}},{"code_sha256_prefix":"0f3f4f4d6935d46d","entry":"get_top_k_keys","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/steer.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/steer.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0f3f4f4d6935d46d"}},{"code_sha256_prefix":"14f95d42884c5248","entry":"judge","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/judge.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/judge.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"14f95d42884c5248"}},{"code_sha256_prefix":"04576b9fbc4350fb","entry":"load_model","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"04576b9fbc4350fb"}},{"code_sha256_prefix":"c5c3f8ddf9c8f027","entry":"load_model","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/extract_activations.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/extract_activations.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c5c3f8ddf9c8f027"}},{"code_sha256_prefix":"43313c83caddac01","entry":"normalize_model_name","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/metrics.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"43313c83caddac01"}},{"code_sha256_prefix":"38cc00f7dd2063f3","entry":"parse_responses_filename","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/metrics.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"38cc00f7dd2063f3"}},{"code_sha256_prefix":"97c9e69ad485811e","entry":"process_csv","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/judge.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/judge.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"97c9e69ad485811e"}},{"code_sha256_prefix":"3b175aa03bebc2cd","entry":"run_dialogue","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/dialogue.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/dialogue.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3b175aa03bebc2cd"}},{"code_sha256_prefix":"2fae33f948016c66","entry":"to_request","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2fae33f948016c66"}},{"code_sha256_prefix":"1187780cd86be681","entry":"train_probes_for_activation","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/train_probe.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/train_probe.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1187780cd86be681"}},{"code_sha256_prefix":"0bf47002af989a65","entry":"train_single_probe","repo":"rifoagenadi/sycophancy","repo_kind":"found_in_text","path":"extension/train_probe.py","file_url":"https://github.com/rifoagenadi/sycophancy/blob/HEAD/extension/train_probe.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0bf47002af989a65"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}