rohand's picture
release
74d0541
|
raw
history blame
14.7 kB
metadata
language:
  - en
tag:
  - doc-chat
  - DocChat
  - dragon
  - retriever
  - conversation
  - multi-turn
  - conversational query
license:
  - other

Model Information

We are excited to announce the release of Cerebras DocChat, our first iteration of models designed for document-based conversational question answering. This series includes two models: Cerebras Llama3-DocChat, a large language model (LLM), and Cerebras Dragon-DocChat, a multi-turn retriever model.

This model – Cerebras Dragon-DocChat – was built on top of Dragon+ and finetuned using ChatQA’s conversational Q&A dataset. The finetuning process took minutes on one Cerebras system (yes you read that correctly), and yields 8.9% and 3.5% absolute improvements in recall over Dragon+ and ChatQA Dragon-Multiturn (top-1).

Note that like its predecessors, Cerebras Dragon-DocChat is a dual-encoder embedding model. This model card is for the question encoder. You can find the context encoder's model card here.

You can find more information about DocChat at the following locations:

Results

DocChat Retriever was evaluated on five multi-turn QA datasets.

Benchmark
Metric Facebook Dragon+ Nvidia Dragon-Multiturn Cerebras Dragon-DocChat
Doc2Dial Recall@1 43.95 50.11 51.54
Recall@5 77.61 83.85 83.12
Recall@20 92.05 95.33 95.25
QuAC Recall@1 62.09 60.02 61.30
Recall@5 86.01 86.51 87.69
Recall@20 96.48 96.60 97.25
QReCC Recall@1 49.00 49.43 55.41
Recall@5 85.14 86.6 90.11
Recall@20 97.21 98.28 98.39
INSCIT* Recall@1 11.13 18.35 21.65
Recall@5 29.27 48.45 50.72
Recall@20 49.07 66.19 72.78
Topiocqa* Recall@1 29.19 31.34 38.19
Recall@5 62.52 65.79 72.47
Recall@20 83.69 84.37 87.23
Average** Avg top 1 49.36 54.76 58.29
Avg top 5 76.30 81.50 84.19

*Evaluated on a subset of the wikipedia corpus that was available to us. All models use the same evaluation strategy to ensure apples-to-apples comparisons.

** We follow the same convention as in ChatQA, where we compare top-5 and top-20 of TopiOCQA and INSCIT to top-1 and top-5, respectively, of the other datasets, in order match differences in average context length.

Prompt Format

In order to maintain consistency, we follow the same format as ChatQA. The chat history should be concatenated into a single query, as follows:

user: {user turn 1}
agent: {agent turn 1}
...
user: {current user turn}

Example Usages

# Demonstration of DocChat retriever in a multi-turn setting
# The sample documents are from a spec sheet about the Cerebras system & supercomputers

from transformers import AutoTokenizer, AutoModel
import torch

tokenizer = AutoTokenizer.from_pretrained("cerebras/Dragon-DocChat-Query-Encoder")
query_encoder = AutoModel.from_pretrained("cerebras/Dragon-DocChat-Query-Encoder")
context_encoder = AutoModel.from_pretrained("cerebras/Dragon-DocChat-Context-Encoder")

documents = []
documents.append("""
# Cerebras Wafer-Scale Cluster

The Cerebras Wafer-Scale Cluster (WSC) is a revolutionary technology suite that efficiently handles the enormous computational needs of AI model training. It centers around the CS-3 system, powered by the 3rd generation Wafer-Scale Engine (WSE-3)—the world’s largest AI-optimized processor. The WSC integrates MemoryX for high-capacity, off-chip model weight storage, and SwarmX for effective weight broadcasting and gradient reduction across the cluster. This setup allows the WSC to adeptly train multi-trillion parameter models, achieving near perfect linear-scaled performance and simplifying the complexity seen in traditional distributed computing.

The Cerebras WSE-3 is 46,250 square millimeters of silicon, 4 trillion transistors, 900K cores, 44 GB on-chip memory, and delivers an unparalleled 125 petaFLOPS of AI compute. It surpasses all other processors in AI-optimized cores, memory speed, and on-chip fabric bandwidth.
""")
documents.append("""
## AI Supercomputers

Condor Galaxy (CG), the supercomputer built by G42 and Cerebras, is the simplest and fastest way to build AI models in the cloud. With over 16 ExaFLOPs of AI compute, Condor Galaxy trains the most demanding models in hours rather than days. The terabyte scale MemoryX system natively accommodates 100 billion+ parameter models, making large scale training simple and efficient.

| Cluster  | ExaFLOPs | Systems  | Memory |
| -------- | -------- | -------- | ------ |
| CG1      | 4        | 64 CS-2s | 82 TB  |
| CG2      | 4        | 64 CS-2s | 82 TB  |
| CG3      | 8        | 64 CS-3s | 108 TB |
""")


query = [
    {"role": "user", "content": "How many cores does a WSE-3 have?"},
    {"role": "agent", "content": "WSE-3 has 900k cores."},
    {"role": "user", "content": "What is Condor Galaxy?"}
]

formatted_query = "\n".join([turn["role"] + ": " + turn["content"] for turn in query]).strip()

query_input = tokenizer(formatted_query, return_tensors='pt')
ctx_input = tokenizer(documents, padding=True, truncation=True, max_length=512, return_tensors='pt')
query_emb = query_encoder(**query_input).last_hidden_state[:, 0, :]
ctx_emb = context_encoder(**ctx_input).last_hidden_state[:, 0, :]

## Compute similarity scores:
similarities = query_emb.matmul(ctx_emb.transpose(0, 1)) # (1, num_ctx)

## Rank the similarity from highest to lowest
ranked_results = torch.argsort(similarities, dim=-1, descending=True) # (1, num_ctx)

for i, doc_idx in enumerate(ranked_results[0].tolist()):
    print(f"Rank {i}th document:")
    print("-" * 80)
    print(documents[doc_idx])
    print()

License

This model was trained from Dragon+, and therefore is subject to its license. Furthermore, it is trained on ChatQA's synthetic conversational QA dataset which was generated using GPT-4. As a result this model can be used for non-commercial purposes only, and is subject to Terms of Use of the data generated by OpenAI.

Acknowledgements

DocChat was built on top of a large body of ML work, spanning training datasets, recipes, and evaluation. We want to thank each of these resources.

@article{lin_dragon_2023,
    title = How to Train Your DRAGON: Diverse Augmentation Towards Generalizable Dense Retrieval,
    url = {https://arxiv.org/abs/2302.07452},
    publisher = {arXiv},
    journal = {arXiv e-print 2302.07452},
    author = {Sheng-Chieh Lin, Akari Asai, Minghan Li, Barlas Oguz, Jimmy Lin, Yashar Mehdad, Wen-tau Yih, Xilun Chen},
    year = {2023},
}
@inproceedings{feng2020doc2dial,
  title={doc2dial: A Goal-Oriented Document-Grounded Dialogue Dataset},
  author={Feng, Song and Wan, Hui and Gunasekara, Chulaka and Patel, Siva and Joshi, Sachindra and Lastras, Luis},
  booktitle={Proceedings of the 2020 Conference on EMNLP},
  year={2020}
}
@inproceedings{choi2018quac,
  title={QuAC: Question Answering in Context},
  author={Choi, Eunsol and He, He and Iyyer, Mohit and Yatskar, Mark and Yih, Wen-tau and Choi, Yejin and Liang, Percy and Zettlemoyer, Luke},
  booktitle={Proceedings of the 2018 Conference on EMNLP},
  year={2018}
}
@inproceedings{anantha2021open,
  title={Open-Domain Question Answering Goes Conversational via Question Rewriting},
  author={Anantha, Raviteja and Vakulenko, Svitlana and Tu, Zhucheng and Longpre, Shayne and Pulman, Stephen and Chappidi, Srinivas},
  booktitle={Proceedings of the 2021 Conference on NAACL},
  year={2021}
}
@article{adlakha2022topiocqa,
  title={TopiOCQA: Open-domain Conversational Question Answering with Topic Switching},
  author={Adlakha, Vaibhav and Dhuliawala, Shehzaad and Suleman, Kaheer and de Vries, Harm and Reddy, Siva},
  journal={Transactions of the Association for Computational Linguistics},
  year={2022}
}
@article{wu2023inscit,
  title={InSCIt: Information-Seeking Conversations with Mixed-Initiative Interactions},
  author={Wu, Zeqiu and Parish, Ryu and Cheng, Hao and Min, Sewon and Ammanabrolu, Prithviraj and Ostendorf, Mari and Hajishirzi, Hannaneh},
  journal={Transactions of the Association for Computational Linguistics},
  year={2023}
}