You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Access to this model is automatically granted upon accepting the AI2 ImpACT License - Medium Risk Artifacts (“MR Agreement”) and completing all fields below.

Log in or Sign Up to review the conditions and access this model content.

Model Card for Kaleido

Model Description

Kaleido is a multi-task seq2seq model designed to generate, explain, and output the relevance and valence of contextualized values, rights, and duties, distilled from GPT-4 generated data.

Uses

It is intended to be used for research purposes to a) understand how well large language models can approximate pluralistic human values and b) to make an open, transparent attempt to increase the capabilities of LLMs to model human values.

Out-of-Scope Use

The model is not intended to be used for advice, human-facing applications, or other purposes.

Bias, Risks, and Limitations

Significant research has explored bias and fairness issues with language models (see, e.g., Sheng et al. (2021) and Bender et al. (2021)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.

Additionally, certain groups may be represented better in the model's outputs than others, and the fact that the data is entirely in English and generated by predominantly by English speakers/LLMs trained on English, the model's outputs likely fit perspectives from English-speaking countries better.

The relevance score should not be interpreted as an importance score, but, due to the composition of the training data, corresponds more closely with "is this value likely to have been generated for this situation by GPT-4?"

Recommendations

We recommend that this model not be used for any high-impact or human-facing purposes as its biases and limitations need to be further explored. We intend this to be a research artifact to advance AI's ability to model and interact with pluralistic human values, rights, and duties.

Training Details

Training Data

The model is trained on the mixture training split of ValuePrism.

Training Procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 3e-05
  • train_batch_size: 32
  • eval_batch_size: 8
  • seed: 42
  • distributed_type: multi-GPU
  • num_devices: 2
  • total_train_batch_size: 64
  • total_eval_batch_size: 16
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 4.0

Framework versions

  • Transformers 4.22.0.dev0
  • Pytorch 1.12.1+cu113
  • Datasets 2.4.0
  • Tokenizers 0.12.1

Testing Data, Factors & Metrics

Testing Data

The model is tested on the four subtasks in ValuePrism.

Metrics

Accuracy is used for relevance and valence, as they are classification tasks, and perplexity is used for generation and explanation, as they are free text generation tasks.

Results

Model Relevance Acc ↑ Valence Acc ↑ Generative Perp ↓ Explanation Perp ↓
kaleido-xxl (11B) 89.1 81.9 2.22 2.99
kaleido-xl (3B) 88.4 80.8 2.23 3.14
kaleido-large (770M) 87.2 79.2 2.34 3.52
kaleido-base (220M) 83.5 74.5 2.53 4.23
kaleido-small (60M) 66.0 59.7 2.86 5.70

Model Architecture and Objective

Kaleido is an encoder-decoder T5-based model trained using negative log-likelihood.

Citation

BibTeX:

@misc{sorensen2023value,
      title={Value Kaleidoscope: Engaging AI with Pluralistic Human Values, Rights, and Duties}, 
      author={Taylor Sorensen and Liwei Jiang and Jena Hwang and Sydney Levine and Valentina Pyatkin and Peter West and Nouha Dziri and Ximing Lu and Kavel Rao and Chandra Bhagavatula and Maarten Sap and John Tasioulas and Yejin Choi},
      year={2023},
      eprint={2309.00779},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Model Card Contact

Contact Taylor Sorensen (tsor13@cs.washington.edu) for any questions about this model.

How to Get Started with the Model

Use the code below to get started with the model.

Load the model:

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

model_name = 'allenai/kaleido-small'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)

Each task ('generate', 'relevance', 'valence', 'explanation') has its own template that can be accessed from the model config.

task = 'generate' # can be 'generate', 'relevance', 'valence', or 'explanation'
model.config.task_specific_params[task]['template']

Output:

'[Generate]:\tAction: ACTION'

The generate template requires ACTION, while the other three templates require ACTION, VRD ('Value', 'Right', or 'Duty') and TEXT. Replace the arguments with the text and generate with the model.

Generate example:

action = 'Go to the gym'
input_text = model.config.task_specific_params['generate']['template'].replace('ACTION', action)
# tokenize
input_ids = tokenizer.encode(input_text, return_tensors='pt')
# generate
output_ids = model.generate(input_ids, max_length=64)
# decode
output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
output_text

Output:

'Value: Personal growth'

Valence example:

action = 'Go to the gym'
vrd = 'Value'
text = 'Health'
input_text = model.config.task_specific_params['valence']['template']
replacements = {
    'ACTION': action,
    'VRD': vrd,
    'TEXT': text
}
for key, value in replacements.items():
    input_text = input_text.replace(key, value)
# tokenize
input_ids = tokenizer.encode(input_text, return_tensors='pt')
# generate
output_ids = model.generate(input_ids, max_length=64)
# decode
output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
output_text

Output:

'Supports'

Alternatively, one could use the KaleidoSys class in the companion git repo which automates templatization and such.

Downloads last month
33
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Dataset used to train allenai/kaleido-small