{"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-19542","title":"Tracking Representation Dynamics in Large Language Models with Persistent Homology","arxiv_id":"2606.19542","date":"2026-06-17","proceeding":null,"authors":["Naman Malhotra","Jay Ambadkar","Abhinav Gupta","Kushal Kasivel","Abbas Schwarz","Kamillo Ferry","Anthea Monod"],"abstract":"Large language models are commonly aligned through supervised fine-tuning, yet little is known about how their internal representations evolve during this process. We study alignment dynamics using persistent homology by tracking the topology of activation spaces throughout fine-tuning. Across four transformer language models ranging from 1B to 7B parameters and three alignment objectives corresponding to helpful, harmless, and mixed training data, we find that the majority of topological reorganization occurs during the earliest stages of training. A dense checkpoint analysis reveals a transient peak in topological activity followed by rapid stabilization. We further show that different alignment objectives induce distinguishable topological trajectories, while instruction-tuned and pretrained models exhibit qualitatively different patterns of evolution. Our results suggest that persistent homology provides a complementary perspective on alignment, revealing representation-level changes that are not apparent from behavioral metrics alone.","url_abs":"https://arxiv.org/abs/2606.19542","url_pdf":"https://arxiv.org/pdf/2606.19542","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":{"syntology_url":"https://syntology.ai/paper/2606.19542","atlas_url":"https://app.syntology.ai/?focus=2606.19542","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2606.19542"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/malhotranaman/tracking-representation-dynamics-with-persistent-homology","reach":null}],"summary":{"ran":23,"unverified":4},"by_repo_kind":{"found_in_text":{"samples":27,"ran":23,"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":"51eac5b0969514f0","entry":"bootstrap_ci","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/stats.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/stats.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"51eac5b0969514f0"}},{"code_sha256_prefix":"010bd987d79354b2","entry":"centroid","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/baselines.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/baselines.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"010bd987d79354b2"}},{"code_sha256_prefix":"e7862623f7a48f35","entry":"centroid_drift","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/baselines.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/baselines.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e7862623f7a48f35"}},{"code_sha256_prefix":"fca13e03452f7848","entry":"correlate","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/trajectories.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/trajectories.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fca13e03452f7848"}},{"code_sha256_prefix":"58620dcaa4abb2eb","entry":"cross_val_accuracy","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/classify.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/classify.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"58620dcaa4abb2eb"}},{"code_sha256_prefix":"b456e001ef79cc16","entry":"feature_trajectory","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/trajectories.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/trajectories.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b456e001ef79cc16"}},{"code_sha256_prefix":"3ded0586954bc634","entry":"fit_full","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/classify.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/classify.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3ded0586954bc634"}},{"code_sha256_prefix":"71935ebe55b1fe12","entry":"get_device","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/device.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/device.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"71935ebe55b1fe12"}},{"code_sha256_prefix":"7aa603bd51e0bc2f","entry":"js","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/divergence.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/divergence.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7aa603bd51e0bc2f"}},{"code_sha256_prefix":"626cff0e7fb7d225","entry":"kl","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/divergence.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/divergence.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"626cff0e7fb7d225"}},{"code_sha256_prefix":"6e3e6544a6c1b59a","entry":"l2_mean_diff","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/stats.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/stats.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6e3e6544a6c1b59a"}},{"code_sha256_prefix":"d376d5df57d73f50","entry":"load_exp1","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/config.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/config.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d376d5df57d73f50"}},{"code_sha256_prefix":"73de5f9e3f567281","entry":"load_exp2","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/config.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/config.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"73de5f9e3f567281"}},{"code_sha256_prefix":"ce79861aaeb0f94f","entry":"make_classifier","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/classify.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/classify.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ce79861aaeb0f94f"}},{"code_sha256_prefix":"2afb52bea555bc85","entry":"pca_summaries","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/pca.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/pca.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2afb52bea555bc85"}},{"code_sha256_prefix":"7b708cec491923b8","entry":"permutation_test","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/stats.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/stats.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7b708cec491923b8"}},{"code_sha256_prefix":"5c2f34c82a56e379","entry":"plot_evolution","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/viz/dynamics_plots.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/viz/dynamics_plots.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5c2f34c82a56e379"}},{"code_sha256_prefix":"d8547f900598f5f0","entry":"plot_grokking_dual","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/viz/dynamics_plots.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/viz/dynamics_plots.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d8547f900598f5f0"}},{"code_sha256_prefix":"939124d0678a49c4","entry":"plot_velocity","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/viz/dynamics_plots.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/viz/dynamics_plots.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"939124d0678a49c4"}},{"code_sha256_prefix":"a3e3458fdf8343c4","entry":"resolve_dtype","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/device.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/device.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a3e3458fdf8343c4"}},{"code_sha256_prefix":"40e12ee7da8f1e50","entry":"subsample_clouds","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/sampling.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/sampling.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"40e12ee7da8f1e50"}},{"code_sha256_prefix":"fdbc97bb9b626e9b","entry":"symmetric_kl","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/divergence.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/divergence.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fdbc97bb9b626e9b"}},{"code_sha256_prefix":"436bdd000624200b","entry":"total_variance","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/baselines.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/baselines.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"436bdd000624200b"}},{"code_sha256_prefix":"3171b6f56f728abf","entry":"describe","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/device.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/device.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":"3171b6f56f728abf"}},{"code_sha256_prefix":"baccdceec0407bef","entry":"global_filtration_range","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/dynamics.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/dynamics.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":"baccdceec0407bef"}},{"code_sha256_prefix":"0d1728208d5ec90a","entry":"run_velocity","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/dynamics.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/dynamics.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":"0d1728208d5ec90a"}},{"code_sha256_prefix":"91527b5241b8ad09","entry":"trajectory_with_ci","repo":"malhotranaman/tracking-representation-dynamics-with-persistent-homology","repo_kind":"found_in_text","path":"src/phlatent/analysis/dynamics.py","file_url":"https://github.com/malhotranaman/tracking-representation-dynamics-with-persistent-homology/blob/HEAD/src/phlatent/analysis/dynamics.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":"91527b5241b8ad09"}}]},"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":{"kind":"leaderboard_placements","source":"Syntology's leaderboard-shaped extractor over the paper's own arXiv-HTML tables: a model pointed at a cell, the number was read from that cell and checked against the board's metric, dataset, split and scale, and an independent check accepted the entry; not reviewed by the paper's authors or the archive's editors","extractor_model":"global.anthropic.claude-sonnet-4-5-20250929-v1:0","verifier_model":null,"prompt_sha":"fa63d4bb9d755694","coverage":{"sentence":"Syntology has checked 6,885 of the 9,623 papers on this site that are newer than the archive; results from the others appear after they are checked.","papers_newer_than_archive":9623,"papers_checked":6885},"entries":[],"not_placed":{"boards":0,"rejected_by_independent_check":0,"refused_by_a_rule":0,"check_did_not_answer":0,"proposed_without_a_cell":0,"declined_by_site":0}}}