nielsr's picture
nielsr HF Staff
Improve Model Card for SHARE LoRA Adapter
19648af verified
|
raw
history blame
8.23 kB
metadata
library_name: transformers
license: mit
pipeline_tag: feature-extraction
language: en
datasets:
  - SHARE
base_model: meta-llama/Meta-Llama-3.1-8B-Instruct
tags:
  - dialogue
  - long-term-dialogue
  - memory
  - conversational
  - llama
  - llm-adapter
  - peft

SHARE: Shared Memory-Aware Open-Domain Long-Term Dialogue Model

This model is a LoRA adapter for meta-llama/Meta-Llama-3.1-8B-Instruct, developed as part of the research presented in the paper SHARE: Shared Memory-Aware Open-Domain Long-Term Dialogue Dataset Constructed from Movie Script.

The paper introduces SHARE, a new long-term dialogue dataset constructed from movie scripts to leverage shared memories for more engaging conversations. It also presents EPISODE, a long-term dialogue framework that utilizes these shared experiences. This model facilitates the extraction of relevant shared memory features from dialogue for downstream tasks related to long-term dialogue understanding and generation, playing a crucial role in enabling the EPISODE framework.

Model Details

Model Description

This model is a PEFT (LoRA) adapter fine-tuned on meta-llama/Meta-Llama-3.1-8B-Instruct. It is designed to work with the SHARE dataset and the EPISODE framework for leveraging shared memories in long-term dialogue. Its primary function is to enable the extraction of contextual features that capture "shared memories" for enhancing conversational agents and enabling more engaging and sustainable long-term dialogues.

  • Model type: LoRA adapter for Causal Language Model (Llama)
  • Language(s) (NLP): English
  • License: MIT
  • Finetuned from model: meta-llama/Meta-Llama-3.1-8B-Instruct

Model Sources [optional]

Uses

Direct Use

This model, when loaded with its base LLM, can be used to extract features that represent shared memories and contextual information from dialogue inputs. These features can then be utilized in various long-term dialogue applications to enhance conversational engagement and coherence within the EPISODE framework.

Downstream Use [optional]

Potential downstream uses include building more engaging and context-aware conversational AI systems that can maintain long-term context and leverage historical interactions, improving chatbots, and advancing research in dialogue systems that require persistent memory and context.

Out-of-Scope Use

This model is specifically trained for long-term dialogue related to shared memories and may not perform optimally for general-purpose text generation or other NLP tasks unrelated to its fine-tuning domain. It should not be used for generating harmful, biased, or misleading content without careful evaluation.

Bias, Risks, and Limitations

The model's performance and potential biases are inherently tied to its training data, the SHARE dataset, which is constructed from movie scripts. As such, it may inherit biases present in cinematic narratives, such as stereotypes, oversimplifications of human relationships, or a focus on specific types of interactions. Further evaluation on diverse datasets is recommended to identify and mitigate any such limitations.

Recommendations

Users (both direct and downstream) should be made aware of the model's training data source and its potential for reflecting biases present in movie scripts. Careful ethical review and bias mitigation strategies should be applied before deploying in real-world scenarios, especially in sensitive applications.

How to Get Started with the Model

To use this LoRA adapter, you need to load the base model (meta-llama/Meta-Llama-3.1-8B-Instruct) and then load the LoRA adapter on top of it using the peft library.

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel, PeftConfig
import torch

# Define your specific model ID on the Hugging Face Hub
# Replace 'your_org/your_model_name' with the actual model ID (e.g., 'naver-api-ai/SHARE_v1')
peft_model_id = "your_org/your_model_name" 

# Load the base model
base_model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
# Ensure to specify torch_dtype and device_map for efficient loading if available
base_model = AutoModelForCausalLM.from_pretrained(base_model_id, torch_dtype=torch.bfloat16, device_map="auto")

# Load the LoRA adapter on top of the base model
model = PeftModel.from_pretrained(base_model, peft_model_id)
# Optional: merge LoRA weights into the base model for easier use, if you don't plan further training
# model = model.merge_and_unload() 

# Example usage for dialogue processing or feature extraction (conceptual)
# The exact method to extract "features" (e.g., embeddings of specific tokens
# representing shared memories) would depend on the implementation of the SHARE framework
# and the EPISODE framework as described in the paper.

# For basic text generation (after merging LoRA, or if using PeftModel directly with .generate()):
# prompt = "Character A: Hi, do you remember our trip to the old lighthouse? Character B: Oh, yes! That stormy day..."
# inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
# outputs = model.generate(**inputs, max_new_tokens=100)
# generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
# print(generated_text)

# For accessing hidden states for feature extraction (conceptual):
# inputs = tokenizer("A dialogue turn that might contain shared memory cues.", return_tensors="pt")
# outputs = model(**inputs, output_hidden_states=True)
# # The features for "shared memories" would likely be specific representations
# # from certain layers or derived from attention mechanisms, as per the paper.
# all_hidden_states = outputs.hidden_states
# # Further processing would be needed to extract relevant "shared memory" features.

print("Model loaded and ready for use with the base model!")

Training Details

Training Data

The model was fine-tuned using the SHARE dataset, which is a novel long-term dialogue dataset constructed from movie scripts. This dataset is designed to be rich in explicit persona information, event summaries, and implicitly extractable shared memories between conversational participants.

Training Procedure

Preprocessing [optional]

[More Information Needed]

Training Hyperparameters

This model uses LoRA (Low-Rank Adaptation) for fine-tuning. Specific training hyperparameters and the training regime would typically be detailed in the associated paper or the project's official code repository.

Evaluation

Testing Data, Factors & Metrics

Testing Data

The paper describes experiments conducted using the SHARE dataset to demonstrate that shared memories make long-term dialogues "more engaging and sustainable."

Factors

The evaluation focuses on the impact of shared memories on dialogue engagement and sustainability.

Metrics

The effectiveness of the EPISODE framework and the role of shared memories are measured by their ability to make dialogues more engaging and sustainable, and by how effectively shared memories are managed during conversation.

Results

The paper demonstrates that shared memories between two individuals make long-term dialogues more engaging and sustainable, and that the EPISODE framework effectively manages shared memories during dialogue.

Citation

If you find the SHARE dataset, the EPISODE framework, or this model helpful in your research, please consider citing the original paper:

@article{share2024longterm,
  title={SHARE: Shared Memory-Aware Open-Domain Long-Term Dialogue Dataset Constructed from Movie Script},
  author={Anonymous}, % Authors not provided in the prompt
  journal={arXiv preprint arXiv:2410.20682},
  year={2024},
  url={https://arxiv.org/abs/2410.20682}
}