{"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-2602-07800","title":"Approximating Matrix Functions with Deep Neural Networks and Transformers","arxiv_id":"2602.07800","date":"2026-02-08","proceeding":null,"authors":["Rahul Padmanabhan","Simone Brugiapaglia"],"abstract":"Transformers have revolutionized natural language processing, but their use for numerical computation has received less attention. We study the approximation of matrix functions, which map scalar functions to matrices, using neural networks including transformers. We focus on functions mapping square matrices to square matrices of the same dimension. These types of matrix functions appear throughout scientific computing, e.g., the matrix exponential in continuous-time Markov chains and the matrix sign function in stability analysis of dynamical systems. In this paper, we make two contributions. First, we prove bounds on the width and depth of ReLU networks needed to approximate the matrix exponential to an arbitrary precision. Second, we show experimentally that a transformer encoder-decoder with suitable numerical encodings can approximate certain matrix functions at a relative error of 5% with high probability. Our study reveals that the encoding scheme strongly affects performance, with different schemes working better for different functions.","url_abs":"https://arxiv.org/abs/2602.07800","url_pdf":"https://arxiv.org/pdf/2602.07800","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=2602.07800","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2602.07800"}},"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/rahul3/LAWT","reach":null}],"summary":{"ran_fixture":2,"ran_violates":1,"ran_draft_wrong":1,"unverified":8},"by_repo_kind":{"found_in_text":{"samples":12,"ran":4,"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":12,"samples":[{"code_sha256_prefix":"a3e27bd1e8b628ed","entry":"Embedding","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/model/transformer.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/model/transformer.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a3e27bd1e8b628ed"}},{"code_sha256_prefix":"cc66d68d2046d6a3","entry":"bool_flag","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/utils.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/utils.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cc66d68d2046d6a3"}},{"code_sha256_prefix":"b2470f4f0c09db41","entry":"get_masks","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/model/transformer.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/model/transformer.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b2470f4f0c09db41"}},{"code_sha256_prefix":"cb6c41af2e200c64","entry":"idx_to_infix","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/evaluator.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/evaluator.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cb6c41af2e200c64"}},{"code_sha256_prefix":"cc07a1ed781ef988","entry":"check_hypothesis","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/evaluator.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/evaluator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"cc07a1ed781ef988"}},{"code_sha256_prefix":"2f7db44ecae76417","entry":"create_logger","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/logger.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/logger.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"2f7db44ecae76417"}},{"code_sha256_prefix":"38b1e59f26ffe6c5","entry":"generate_wigner_matrices","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/envs/generators.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/envs/generators.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"38b1e59f26ffe6c5"}},{"code_sha256_prefix":"122fce61b2b8891b","entry":"get_logger","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/neuralnet/common.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/neuralnet/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"122fce61b2b8891b"}},{"code_sha256_prefix":"d4552faa79e349b3","entry":"get_optimizer","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/optim.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/optim.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"d4552faa79e349b3"}},{"code_sha256_prefix":"c4d4b0ccb9f71797","entry":"initialize_exp","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/utils.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"c4d4b0ccb9f71797"}},{"code_sha256_prefix":"21772223de978a2d","entry":"log_loss","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/neuralnet/common.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/neuralnet/common.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"21772223de978a2d"}},{"code_sha256_prefix":"e7b55aa114a5156a","entry":"timeout","repo":"rahul3/LAWT","repo_kind":"found_in_text","path":"src/utils.py","file_url":"https://github.com/rahul3/LAWT/blob/HEAD/src/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e7b55aa114a5156a"}}]},"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}