Views
No views yet
1@article{LongMem,
2 title={Augmenting Language Models with Long-Term Memory},
3 author={Wang, Weizhi and Dong, Li and Cheng, Hao and Liu, Xiaodong and Yan, Xifeng and Gao, Jianfeng and Wei, Furu},
4 journal={arXiv preprint arXiv:2306.07174},
5 year={2023}
6}pip install faiss-gpu. For Nvidia A100, A6000 GPUs, please run conda install faiss-gpu cudatoolkit=11.0 -c pytorch. The A100 GPU is not officially supported by faiss-gpu, sometimes it will lead to errors, you can refer to this git issue of faiss for help.pip install --editable ./fairseq Then the revised fairseq and dependency packages will be installed. We strongly recommend you to use python 3.8 for stability.pip install -r requirements.txtfairseq/fairseq/models/newgpt.pyfairseq/fairseq/models/sidenet/transformer_decoder_sidenet.pyfairseq/fairseq/models/transformer_lm_sidenet.pyfairseq/fairseq/modules/dynamic_memory_with_chunk.pyfairseq/fairseq/modules/joint_multihead_attention_sum.pypreprocess/filter_shard_tnlg.py fpr how we sample the training set and binalize following standard fairseq preprocessing process.bash train_scripts/train_longmem.shcheckpoints/.# Evaluate gpt2 baseline
python eval_scripts/eval_longmem_icl.py --path /path/to/gpt2_pretrained_model
# Evaluate LongMem model
python eval_scripts/eval_longmem_icl.py --path /path/to/longmem_model --pretrained-model-path /path/to/gpt2_pretrained_model