{"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/automatic-functional-differentiation-in-jax","title":"Automatic Functional Differentiation in JAX","arxiv_id":"2311.18727","date":"2023-11-30","proceeding":null,"authors":["Min Lin"],"abstract":"We extend JAX with the capability to automatically differentiate higher-order functions (functionals and operators). By representing functions as a generalization of arrays, we seamlessly use JAX's existing primitive system to implement higher-order functions. We present a set of primitive operators that serve as foundational building blocks for constructing several key types of functionals. For every introduced primitive operator, we derive and implement both linearization and transposition rules, aligning with JAX's internal protocols for forward and reverse mode automatic differentiation. This enhancement allows for functional differentiation in the same syntax traditionally use for functions. The resulting functional gradients are themselves functions ready to be invoked in python. We showcase this tool's efficacy and simplicity through applications where functional derivatives are indispensable. The source code of this work is released at https://github.com/sail-sg/autofd .","url_abs":"https://arxiv.org/abs/2311.18727v2","url_pdf":"https://arxiv.org/pdf/2311.18727v2.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":"automatic-functional-differentiation-in-jax","repo_url":"https://github.com/sail-sg/autofd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.18727","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.18727"}},"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":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sail-sg/autofd","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":5,"unverified":4},"by_repo_kind":{"official":{"samples":9,"ran":5,"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":"81105f77efdc61f2","entry":"Arg","repo":"sail-sg/autofd","repo_kind":"official","path":"autofd/general_array.py","file_url":"https://github.com/sail-sg/autofd/blob/HEAD/autofd/general_array.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"81105f77efdc61f2"}},{"code_sha256_prefix":"544de4237a1f63c3","entry":"Ret","repo":"sail-sg/autofd","repo_kind":"official","path":"autofd/general_array.py","file_url":"https://github.com/sail-sg/autofd/blob/HEAD/autofd/general_array.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"544de4237a1f63c3"}},{"code_sha256_prefix":"6ca86d5d7a6a9e4a","entry":"complement_argnums","repo":"sail-sg/autofd","repo_kind":"official","path":"autofd/utils.py","file_url":"https://github.com/sail-sg/autofd/blob/HEAD/autofd/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6ca86d5d7a6a9e4a"}},{"code_sha256_prefix":"5189d887912d9b47","entry":"visualize_jaxpr","repo":"sail-sg/autofd","repo_kind":"official","path":"autofd/utils.py","file_url":"https://github.com/sail-sg/autofd/blob/HEAD/autofd/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5189d887912d9b47"}},{"code_sha256_prefix":"e74ecb2cffb1cd39","entry":"weak_lru","repo":"sail-sg/autofd","repo_kind":"official","path":"autofd/utils.py","file_url":"https://github.com/sail-sg/autofd/blob/HEAD/autofd/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e74ecb2cffb1cd39"}},{"code_sha256_prefix":"f12c821c31198760","entry":"compose","repo":"sail-sg/autofd","repo_kind":"official","path":"autofd/operators/transforms.py","file_url":"https://github.com/sail-sg/autofd/blob/HEAD/autofd/operators/transforms.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f12c821c31198760"}},{"code_sha256_prefix":"fedce67ab6d305e9","entry":"permute_args","repo":"sail-sg/autofd","repo_kind":"official","path":"autofd/operators/operators.py","file_url":"https://github.com/sail-sg/autofd/blob/HEAD/autofd/operators/operators.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fedce67ab6d305e9"}},{"code_sha256_prefix":"34126dfb9cb22ec4","entry":"permute_args","repo":"sail-sg/autofd","repo_kind":"official","path":"autofd/operators/transforms.py","file_url":"https://github.com/sail-sg/autofd/blob/HEAD/autofd/operators/transforms.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"34126dfb9cb22ec4"}},{"code_sha256_prefix":"3cbf274470b38c2a","entry":"return_at","repo":"sail-sg/autofd","repo_kind":"official","path":"autofd/operators/transforms.py","file_url":"https://github.com/sail-sg/autofd/blob/HEAD/autofd/operators/transforms.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3cbf274470b38c2a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}