{"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/stabilizing-backpropagation-through-time-to","title":"Stabilizing Backpropagation Through Time to Learn Complex Physics","arxiv_id":"2405.02041","date":"2024-05-03","proceeding":null,"authors":["Patrick Schnell","Nils Thuerey"],"abstract":"Of all the vector fields surrounding the minima of recurrent learning setups, the gradient field with its exploding and vanishing updates appears a poor choice for optimization, offering little beyond efficient computability. We seek to improve this suboptimal practice in the context of physics simulations, where backpropagating feedback through many unrolled time steps is considered crucial to acquiring temporally coherent behavior. The alternative vector field we propose follows from two principles: physics simulators, unlike neural networks, have a balanced gradient flow, and certain modifications to the backpropagation pass leave the positions of the original minima unchanged. As any modification of backpropagation decouples forward and backward pass, the rotation-free character of the gradient field is lost. Therefore, we discuss the negative implications of using such a rotational vector field for optimization and how to counteract them. Our final procedure is easily implementable via a sequence of gradient stopping and component-wise comparison operations, which do not negatively affect scalability. Our experiments on three control problems show that especially as we increase the complexity of each task, the unbalanced updates from the gradient can no longer provide the precise control signals necessary while our method still solves the tasks. Our code can be found at https://github.com/tum-pbs/StableBPTT.","url_abs":"https://arxiv.org/abs/2405.02041v1","url_pdf":"https://arxiv.org/pdf/2405.02041v1.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":"stabilizing-backpropagation-through-time-to","repo_url":"https://github.com/tum-pbs/stablebptt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"GPL-3.0"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.02041","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.02041"}},"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":"deterministic:regex_extraction","url":"https://github.com/tum-pbs/StableBPTT","reach":{"status":"ok","spdx":"GPL-3.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tum-pbs/stablebptt","reach":{"status":"ok","spdx":"GPL-3.0"}}],"summary":{"ran":8,"ran_honours":5,"ran_violates":1,"unverified":3},"by_repo_kind":{"official":{"samples":17,"ran":14,"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":17,"samples":[{"code_sha256_prefix":"4e981accf1c26891","entry":"build_cartpole_step","repo":"tum-pbs/StableBPTT","repo_kind":"official","path":"CartPole/Simulations/01/cartpole_simulator.py","file_url":"https://github.com/tum-pbs/StableBPTT/blob/HEAD/CartPole/Simulations/01/cartpole_simulator.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"4e981accf1c26891"}},{"code_sha256_prefix":"56f6b980a92a5535","entry":"build_fully_connected_network","repo":"tum-pbs/StableBPTT","repo_kind":"official","path":"CartPole/Simulations/01/multi_cartpole_controller.py","file_url":"https://github.com/tum-pbs/StableBPTT/blob/HEAD/CartPole/Simulations/01/multi_cartpole_controller.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"56f6b980a92a5535"}},{"code_sha256_prefix":"0a7b9cbe206e6eb3","entry":"build_fully_connected_network","repo":"tum-pbs/StableBPTT","repo_kind":"official","path":"GuidanceByRepulsion/Simulations/01/controller.py","file_url":"https://github.com/tum-pbs/StableBPTT/blob/HEAD/GuidanceByRepulsion/Simulations/01/controller.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"0a7b9cbe206e6eb3"}},{"code_sha256_prefix":"45e03fb897554440","entry":"combine_grad_lists","repo":"tum-pbs/stablebptt","repo_kind":"official","path":"CartPole/Simulations/01/training.py","file_url":"https://github.com/tum-pbs/stablebptt/blob/HEAD/CartPole/Simulations/01/training.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"45e03fb897554440"}},{"code_sha256_prefix":"39b6f73f2a12c388","entry":"combine_grads","repo":"tum-pbs/stablebptt","repo_kind":"official","path":"CartPole/Simulations/01/training.py","file_url":"https://github.com/tum-pbs/stablebptt/blob/HEAD/CartPole/Simulations/01/training.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"39b6f73f2a12c388"}},{"code_sha256_prefix":"8c6890fe4097f6d9","entry":"cosine_similarity","repo":"tum-pbs/stablebptt","repo_kind":"official","path":"CartPole/Simulations/01/training.py","file_url":"https://github.com/tum-pbs/stablebptt/blob/HEAD/CartPole/Simulations/01/training.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"8c6890fe4097f6d9"}},{"code_sha256_prefix":"71c7f883fbdb43ef","entry":"flatten","repo":"tum-pbs/stablebptt","repo_kind":"official","path":"CartPole/Simulations/01/training.py","file_url":"https://github.com/tum-pbs/stablebptt/blob/HEAD/CartPole/Simulations/01/training.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"71c7f883fbdb43ef"}},{"code_sha256_prefix":"c0a943c1eb479ed7","entry":"generate_data","repo":"tum-pbs/StableBPTT","repo_kind":"official","path":"CartPole/Simulations/01/multi_cartpole_data.py","file_url":"https://github.com/tum-pbs/StableBPTT/blob/HEAD/CartPole/Simulations/01/multi_cartpole_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"c0a943c1eb479ed7"}},{"code_sha256_prefix":"f2848b08a4c40e9e","entry":"get_cnn","repo":"tum-pbs/StableBPTT","repo_kind":"official","path":"QuantumControl/Simulations/01/model.py","file_url":"https://github.com/tum-pbs/StableBPTT/blob/HEAD/QuantumControl/Simulations/01/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"f2848b08a4c40e9e"}},{"code_sha256_prefix":"b940953a8f2b9046","entry":"get_grad_size","repo":"tum-pbs/stablebptt","repo_kind":"official","path":"CartPole/Simulations/01/training.py","file_url":"https://github.com/tum-pbs/stablebptt/blob/HEAD/CartPole/Simulations/01/training.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"b940953a8f2b9046"}},{"code_sha256_prefix":"20f22216033f2760","entry":"ip","repo":"tum-pbs/stablebptt","repo_kind":"official","path":"CartPole/Simulations/01/training.py","file_url":"https://github.com/tum-pbs/stablebptt/blob/HEAD/CartPole/Simulations/01/training.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"20f22216033f2760"}},{"code_sha256_prefix":"fe2aaf4d7dfeea4b","entry":"norm","repo":"tum-pbs/stablebptt","repo_kind":"official","path":"CartPole/Simulations/01/training.py","file_url":"https://github.com/tum-pbs/stablebptt/blob/HEAD/CartPole/Simulations/01/training.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"fe2aaf4d7dfeea4b"}},{"code_sha256_prefix":"3535a6b21fee4747","entry":"plot_result","repo":"tum-pbs/StableBPTT","repo_kind":"official","path":"GuidanceByRepulsion/Plots/01/plot.py","file_url":"https://github.com/tum-pbs/StableBPTT/blob/HEAD/GuidanceByRepulsion/Plots/01/plot.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"3535a6b21fee4747"}},{"code_sha256_prefix":"1569ed10a35adc48","entry":"smooth","repo":"tum-pbs/StableBPTT","repo_kind":"official","path":"CartPole/Plots/01/plot.py","file_url":"https://github.com/tum-pbs/StableBPTT/blob/HEAD/CartPole/Plots/01/plot.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"1569ed10a35adc48"}},{"code_sha256_prefix":"9a4d2905ab3a2f2c","entry":"LOSS_FORMULATION","repo":"tum-pbs/stablebptt","repo_kind":"official","path":"CartPole/Simulations/01/training.py","file_url":"https://github.com/tum-pbs/stablebptt/blob/HEAD/CartPole/Simulations/01/training.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"9a4d2905ab3a2f2c"}},{"code_sha256_prefix":"9158e670575df814","entry":"TRAINING_SETUP","repo":"tum-pbs/stablebptt","repo_kind":"official","path":"CartPole/Simulations/01/training.py","file_url":"https://github.com/tum-pbs/stablebptt/blob/HEAD/CartPole/Simulations/01/training.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"9158e670575df814"}},{"code_sha256_prefix":"76e0755b5f3aa4f4","entry":"plot_result","repo":"tum-pbs/StableBPTT","repo_kind":"official","path":"CartPole/Plots/01/plot.py","file_url":"https://github.com/tum-pbs/StableBPTT/blob/HEAD/CartPole/Plots/01/plot.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"76e0755b5f3aa4f4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}