Skip to content

[NAACL 2025] The implementation of paper "Hello Again! LLM-powered Personalized Agent for Long-term Dialogue".

License

Notifications You must be signed in to change notification settings

leolee99/LD-Agent

Repository files navigation

Hello Again! LLM-powered Personalized Agent for Long-term Dialogue

Github license
Hao Li1*, Chenghao Yang2*, An Zhang1, Yang Deng3, Xiang Wang2, Tat-Seng Chua1,
1National University of Singapore
2University of Science and Technology of China
3Singapore Management University

The official implementation of NAACL 2025 paper "Hello Again! LLM-powered Personalized Agent for Long-term Dialogue".

🎉 News

  • [2025.2.13] 🛠️ We update the data sampling code.
  • [2025.1.26] 🎉🎉 Our paper has been accepted to NAACL 2025.

⚙️ Preparations

Environment Requirements

We recommend the following dependencies:

Then, please install other environment dependencies through:

pip install -r requirements.txt

The recommended GPU memory is more than 32 GB.

Dataset Preparation

The datasets for event summary, persona extraction, response generation and MSC can be downloaded here. Please organize the dataset path as LD-Agent/dataset.

Metric Preparation

To automatically evaluate response quality, you should download the compressed metric files here. Then decompress it and organize it to LD-Agent/nlgeval/metric.

💾 Checkpoints

You can download our tuned checkpoints of extractor, summarizer, and generator here.

💡 Quick Start

Training

We refer to the training approach of ChatGLM3-6B and separately provide LoRA tuning strategy for event summary, persona extraction, and response generation. You can run the following instructions to train these modules.

Summarizer

bash scripts/summarizer_tuning.sh

Extractor

bash scripts/extractor_tuning.sh

Generator

bash scripts/generator_tuning.sh

You can adjust the detailed training configs in Trainer/configs.

Evaluation

We provide the evaluation implementations on both ChatGPT and ChatGLM3-6B.

ChatGPT

To evaluate using ChatGPT, you can edit the ${API_KEY} in scripts/msc_gpt_eval.sh to your openai API key and run:

bash scripts/msc_gpt_eval.sh

ChatGLM

To evaluate using ChatGLM3-6B, you can run:

bash scripts/msc_glm_eval.sh

Edit the ${SUMMARIZER}, ${EXTRACTOR}, and ${GENERATOR} to specify the LoRA models used for event summary, persona extraction, and response generation, respectively. The setting of "default" indicates employing original ChatGLM to the target module.

Evaluation with Annotated Personas on MSC

We also provide an evaluation process on MSC using its annotations as personas:

bash scripts/msc_glm_quick_eval.sh

Data Sampling

If you want to sample data using your self-trained summarizer, extractor, and generator. Please edit the ${SAMPLING_PATH} to the save path, and then run:

bash scripts/msc_glm_sampling.sh

📑 To DO

  • Code and datasets of CC.

📖 Reference

If you found this code useful, please cite the following paper:


@article{LDAgent,
  title={Hello Again! LLM-powered Personalized Agent for Long-term Dialogue},
  author={Li, Hao and 
          Yang, Chenghao and 
          Zhang, An and 
          Deng, Yang and 
          Wang, Xiang and 
          Chua, Tat-Seng},
  journal={NAACL},
  year={2025}
}

About

[NAACL 2025] The implementation of paper "Hello Again! LLM-powered Personalized Agent for Long-term Dialogue".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published