jbloomAus / DecisionTransformerInterpretability

Interpreting how transformers simulate agents performing RL tasks
https://jbloomaus-decisiontransformerinterpretability-app-4edcnc.streamlit.app/
MIT License
61 stars 15 forks source link

Added cache to most static analyses, refactored app.py. #88

Closed JayBaileyCS closed 1 year ago

JayBaileyCS commented 1 year ago

Changed some old analysis functions to better fit the displays. Changed the display order to be the same as the analysis order on the left. Upgraded to Streamlit 1.18. Added caching to all static analyses except dimensionality reduction and qk circuit.

Note: static_analysis_component changes are mostly changing dt to _dt, since dt can't be cached and _varname tells Streamlit not to try. They can be skimmed.

Unit and acceptance tests are working and the static analyses look good but I haven't examined everything or all the other analyses - if necessary I can move back to Streamlit 1.16 and uncache things if things go wrong. I suspect this is relatively unlikely but I can't be sure. I did find one issue that Streamlit 1.18 caused by depreciating an old st.cache keyword argument, but it was a runtime error in the app that threw an error immediately, so it was easily spotted. This bodes well, I think - a problem that did occur was easily noticable.