{"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/persistent-topological-features-in-large","title":"Persistent Topological Features in Large Language Models","arxiv_id":"2410.11042","date":"2024-10-14","proceeding":null,"authors":["Yuri Gardinazzi","Karthik Viswanathan","Giada Panerai","Alessio Ansuini","Alberto Cazzaniga","Matteo Biagetti"],"abstract":"Understanding the decision-making processes of large language models is critical given their widespread applications. To achieve this, we aim to connect a formal mathematical framework - zigzag persistence from topological data analysis - with practical and easily applicable algorithms. Zigzag persistence is particularly effective for characterizing data as it dynamically transforms across model layers. Within this framework, we introduce topological descriptors that measure how topological features, $p$-dimensional holes, persist and evolve throughout the layers. Unlike methods that assess each layer individually and then aggregate the results, our approach directly tracks the full evolutionary path of these features. This offers a statistical perspective on how prompts are rearranged and their relative positions changed in the representation space, providing insights into the system's operation as an integrated whole. To demonstrate the expressivity and applicability of our framework, we highlight how sensitive these descriptors are to different models and a variety of datasets. As a showcase application to a downstream task, we use zigzag persistence to establish a criterion for layer pruning, achieving results comparable to state-of-the-art methods while preserving the system-level perspective.","url_abs":"https://arxiv.org/abs/2410.11042v3","url_pdf":"https://arxiv.org/pdf/2410.11042v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"persistent-topological-features-in-large","repo_url":"https://github.com/RitAreaSciencePark/ZigZagLLMs","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"decision-making","task_name":"Decision Making"},{"task_slug":"topological-data-analysis","task_name":"Topological Data Analysis"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2410.11042","atlas_url":"https://app.syntology.ai/?focus=2410.11042","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.11042"}},"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":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/RitAreaSciencePark/ZigZagLLMs","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran":4,"ran_honours":1,"ran_fixture":2,"unverified":1},"by_repo_kind":{"official":{"samples":10,"ran":9,"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":"d8f3a9f76735c093","entry":"check_dir","repo":"ritareasciencepark/zigzagllms","repo_kind":"official","path":"src/benchmark/benchmark.py","file_url":"https://github.com/ritareasciencepark/zigzagllms/blob/HEAD/src/benchmark/benchmark.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d8f3a9f76735c093"}},{"code_sha256_prefix":"d1af30de1d59a5a9","entry":"div","repo":"RitAreaSciencePark/ZigZagLLMs","repo_kind":"official","path":"src/benchmark/post_process.py","file_url":"https://github.com/RitAreaSciencePark/ZigZagLLMs/blob/HEAD/src/benchmark/post_process.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":"d1af30de1d59a5a9"}},{"code_sha256_prefix":"8360fa8b0b26a936","entry":"flattening_for_zigzag_ver","repo":"ritareasciencepark/zigzagllms","repo_kind":"official","path":"src/zigzag/run_fast_zigzag.py","file_url":"https://github.com/ritareasciencepark/zigzagllms/blob/HEAD/src/zigzag/run_fast_zigzag.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8360fa8b0b26a936"}},{"code_sha256_prefix":"4a6302d7905ab810","entry":"get_embdims","repo":"RitAreaSciencePark/ZigZagLLMs","repo_kind":"official","path":"src/representation/rep-extraction/intrinsic_dimension/compute_distances.py","file_url":"https://github.com/RitAreaSciencePark/ZigZagLLMs/blob/HEAD/src/representation/rep-extraction/intrinsic_dimension/compute_distances.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":"4a6302d7905ab810"}},{"code_sha256_prefix":"d925e138f4a79f89","entry":"get_intersection","repo":"RitAreaSciencePark/ZigZagLLMs","repo_kind":"official","path":"src/zigzag/utils/fclaux.py","file_url":"https://github.com/RitAreaSciencePark/ZigZagLLMs/blob/HEAD/src/zigzag/utils/fclaux.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":"d925e138f4a79f89"}},{"code_sha256_prefix":"29437b95d5fb999a","entry":"get_isin","repo":"RitAreaSciencePark/ZigZagLLMs","repo_kind":"official","path":"src/zigzag/utils/fclaux.py","file_url":"https://github.com/RitAreaSciencePark/ZigZagLLMs/blob/HEAD/src/zigzag/utils/fclaux.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":"29437b95d5fb999a"}},{"code_sha256_prefix":"e0c72a9bd230cf23","entry":"iord","repo":"ritareasciencepark/zigzagllms","repo_kind":"official","path":"src/zigzag/run_fast_zigzag.py","file_url":"https://github.com/ritareasciencepark/zigzagllms/blob/HEAD/src/zigzag/run_fast_zigzag.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e0c72a9bd230cf23"}},{"code_sha256_prefix":"ed4aa8002a88c246","entry":"layers_to_cut_given_r","repo":"ritareasciencepark/zigzagllms","repo_kind":"official","path":"src/benchmark/benchmark.py","file_url":"https://github.com/ritareasciencepark/zigzagllms/blob/HEAD/src/benchmark/benchmark.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ed4aa8002a88c246"}},{"code_sha256_prefix":"b063c470e47070c8","entry":"similarity_persistance","repo":"ritareasciencepark/zigzagllms","repo_kind":"official","path":"src/benchmark/benchmark.py","file_url":"https://github.com/ritareasciencepark/zigzagllms/blob/HEAD/src/benchmark/benchmark.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b063c470e47070c8"}},{"code_sha256_prefix":"5df05607e799aec8","entry":"read_pd_from_csv","repo":"RitAreaSciencePark/ZigZagLLMs","repo_kind":"official","path":"src/benchmark/post_process.py","file_url":"https://github.com/RitAreaSciencePark/ZigZagLLMs/blob/HEAD/src/benchmark/post_process.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":"5df05607e799aec8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}