Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,153 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
-
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
# Model Card for Model ID
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
-
|
| 25 |
-
-
|
| 26 |
-
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
[
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
[
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
## Model Card Authors [optional]
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Model Card Contact
|
| 198 |
-
|
| 199 |
-
[More Information Needed]
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
library_name: transformers
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
license: mit
|
| 7 |
---
|
| 8 |
|
|
|
|
| 9 |
|
| 10 |
+
# DialRet
|
| 11 |
+
<p align="center">
|
| 12 |
+
<picture>
|
| 13 |
+
<img src="./main_fig.png" width="100%" style="margin: 0px auto;">
|
| 14 |
+
</picture>
|
| 15 |
+
|
| 16 |
+
Proceedings of PAKDD 2025 paper "DialRet: Enhancing Dialogue Retention for Multi-Session Conversations"
|
| 17 |
+
Yohan Na*, Dahye Kim*, and Dong-Kyu chae.
|
| 18 |
+
|
| 19 |
+
<p align="center"> 🤗 <a href="https://huggingface.co/collections/DILAB-HYU/">Models</a>   |   📜 <a href="https://">Paper</a> |   💻 <a href="https://github.com/"> Github </a>
|
| 20 |
+
|
| 21 |
+
> [!Note]
|
| 22 |
+
> The paper is written from a multi-session dialogue perspective, which is far from the instruction performance targeted by recent models.
|
| 23 |
+
|
| 24 |
+
## Table of Contents
|
| 25 |
+
|
| 26 |
+
- [Introduction](#introduction)
|
| 27 |
+
- [Model Performance](#performance)
|
| 28 |
+
- [Quickstart](#quickstart)
|
| 29 |
+
- [License](#license)
|
| 30 |
+
- [Citation](#citation)
|
| 31 |
+
- [Contributors](#contributors)
|
| 32 |
+
- [Contact](#contact)
|
| 33 |
+
|
| 34 |
+
<br>
|
| 35 |
+
|
| 36 |
+
## Introduction
|
| 37 |
+
DialRet is a dialogue-specific language model designed for multi-session conversations.
|
| 38 |
+
Instead of using memory modules, it leverages long-context LMs and instruction-tuning across eight tasks (e.g., dialogue generation, summarization, speaker relation extraction).
|
| 39 |
+
It improves understanding and retention of past dialogues.
|
| 40 |
+
|
| 41 |
+
The paper also introduces MSC-Bench, a benchmark evaluating dialogue models on memorability, specificity, engagement, and humanness.
|
| 42 |
+
Experiments show DialRet outperforms existing models in multi-session dialogue quality and retention.
|
| 43 |
+
|
| 44 |
+
### Model Performance
|
| 45 |
+
Below are partial report on the performance of the `DialRet`. Please refer to the [Paper](https://) for the full results.
|
| 46 |
+

|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
## Quickstart
|
| 51 |
+
|
| 52 |
+
#### Example Usage for `DialRet`
|
| 53 |
+
```python
|
| 54 |
+
import torch
|
| 55 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 56 |
+
|
| 57 |
+
model_name = "DILAB-HYU/DialRet-L1"
|
| 58 |
+
|
| 59 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 60 |
+
model_name,
|
| 61 |
+
torch_dtype=torch.bfloat16,
|
| 62 |
+
trust_remote_code=True,
|
| 63 |
+
).to("cuda")
|
| 64 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 65 |
+
|
| 66 |
+
session_num = 3
|
| 67 |
+
session_role_1 = "Neighbors A"
|
| 68 |
+
session_role_2 = "Neighbors B"
|
| 69 |
+
session_system_prompt = f"You will be shown a {session_num} session dialogues between {session_role_1} and {session_role_2}. Please read and understand given multiple Dialogue Session, then complete the task under the guidance of Task Introduction.\n\n"
|
| 70 |
+
|
| 71 |
+
session_input = """```
|
| 72 |
+
Dialogue Session #1:
|
| 73 |
+
Neighbors A:Hi there! I saw your cat in my backyard earlier. She's quite cute. What's her name?
|
| 74 |
+
Neighbors B:Oh, thanks! Her name is Luna. She's a rescue cat.
|
| 75 |
+
Neighbors A:That's really cool. How old is she?
|
| 76 |
+
Neighbors B:She's about 2 years old.
|
| 77 |
+
Neighbors A:Does she like being outside?
|
| 78 |
+
Neighbors B:Not really. She's pretty much an indoor cat. She likes to snuggle up and sleep all day.
|
| 79 |
+
Neighbors A:That's adorable. My kids would love her!
|
| 80 |
+
Neighbors B:You're welcome to come over and visit her anytime.
|
| 81 |
+
Neighbors A:Thanks, I'd love to! By the way, did you get your fence fixed?
|
| 82 |
+
Neighbors B:Yes, we had it repaired last weekend. It was a relief to finally get it fixed.
|
| 83 |
+
Neighbors A:I'm glad to hear that. Did you have to call in a professional?
|
| 84 |
+
Neighbors B:Yeah, we had to call a fencing company to come and take care of it. They did a great job though, so we're happy with the results.
|
| 85 |
+
Neighbors A:Good to know! I may have to call them too if I ever need fence repairs.
|
| 86 |
+
Neighbors B:Absolutely, I can give you their contact information if you'd like.
|
| 87 |
+
Neighbors A:Thanks, I appreciate it. Anyway, I won't keep you too long. Thanks for telling me about Luna!
|
| 88 |
+
Neighbors B:No problem, happy to talk about her. See you later!
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
```
|
| 92 |
+
Dialogue Session #2:
|
| 93 |
+
Neighbors A:Can you believe it? A tree just fell on my car!
|
| 94 |
+
Neighbors B:Oh no! Are you okay?
|
| 95 |
+
Neighbors A:Yeah, luckily I wasn't in it at the time. But my car is completely totaled.
|
| 96 |
+
Neighbors B:That's terrible. Did you call your insurance company?
|
| 97 |
+
Neighbors A:Not yet, I'm still in shock. Plus, I was in the middle of reading a really interesting book about philosophy.
|
| 98 |
+
Neighbors B:Oh, what book are you reading?
|
| 99 |
+
Neighbors A:It's called "The Republic" by Plato. It's all about the concept of justice and government.
|
| 100 |
+
Neighbors B:That sounds really fascinating. I've always been interested in philosophy, but I never know where to start.
|
| 101 |
+
Neighbors A:Well, "The Republic" is a classic. But if you're just starting out, I'd recommend "Meditations" by Marcus Aurelius. It's a great introduction to Stoicism.
|
| 102 |
+
Neighbors B:Thanks for the recommendation. I'll definitely check it out. But in the meantime, let's get your car situation sorted out. Do you need any help with anything?
|
| 103 |
+
Neighbors A:That would be great, actually. Do you have any experience dealing with insurance companies?
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
```
|
| 107 |
+
Dialogue Session #3:
|
| 108 |
+
Neighbors A:Hey, Neighbors B. I have a bit of a problem and was hoping you could help me out.
|
| 109 |
+
Neighbors B:Sure thing! What's going on?
|
| 110 |
+
Neighbors A:Well, I'm having some trouble with my computer. It's just not working the way it should be, and I don't know what to do.
|
| 111 |
+
Neighbors B:Ah, I see. What kind of issues are you having?
|
| 112 |
+
Neighbors A:The screen keeps freezing up, and I can't seem to get anything done. I'm really getting frustrated because I have some important work that needs to be done.
|
| 113 |
+
Neighbors B:Hmm, that sounds really frustrating. I think I might be able to help, though. Have you tried restarting your computer?
|
| 114 |
+
Neighbors A: ###
|
| 115 |
+
```"""
|
| 116 |
+
|
| 117 |
+
session_task = """Task Introduction:
|
| 118 |
+
After reading the entire Dialogue Sessions, please create an appropriate response.
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
Task Result:"""
|
| 122 |
+
|
| 123 |
+
input_text= session_system_prompt + session_input + session_task
|
| 124 |
+
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
|
| 125 |
+
|
| 126 |
+
outputs = model.generate(inputs, max_new_tokens=4096, do_sample=False) # Finetuned with length 8192
|
| 127 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 128 |
+
|
| 129 |
+
# Output:
|
| 130 |
+
# Neighbors A:Yeah, I've been trying that but it doesn't seem to be helping.
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
<br>
|
| 134 |
+
|
| 135 |
+
## License
|
| 136 |
+
The `DialRet` models are licensed under [MIT](https://opensource.org/license/mit).
|
| 137 |
+
<br>
|
| 138 |
+
|
| 139 |
+
## Citation
|
| 140 |
+
```
|
| 141 |
+
@article{2025dialret,
|
| 142 |
+
title={DialRet: Enhancing Dialogue Retention forMulti-session Conversations},
|
| 143 |
+
author={Yohan Na, Dahye Kim, Dong-kyu Chae},
|
| 144 |
+
year={2025},
|
| 145 |
+
url={},
|
| 146 |
+
}
|
| 147 |
+
```
|
| 148 |
+
|
| 149 |
+
<br>
|
| 150 |
+
|
| 151 |
+
## Thanks to
|
| 152 |
+
- Yoo Hyun Jeong, Jongsoo Lee, Seonggyeom Kim, Myeongsoo Han, Byeongtae Park, Eunseon Seong, Harim Lee.
|
| 153 |
+
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|