Edit model card


The LongForm dataset is created by leveraging English corpus examples with augmented instructions. We select a diverse set of human-written documents from existing corpora such as C4 and Wikipedia and generate instructions for the given documents via LLMs. Then, we extend these examples with structured corpora examples such as Stack Exchange and WikiHow and task examples such as question answering, email writing, grammar error correction, story/poem generation, and text summarization.

Github Repo: https://github.com/akoksal/LongForm

For LongForm OPT and LLaMA models: Use [EOI] to indicate the end of instruction.

How to Load

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("akoksal/LongForm-OPT-1.3B")
tokenizer = AutoTokenizer.from_pretrained("akoksal/LongForm-OPT-1.3B")

instruction = "Write an essay about meditation. [EOI]"
input_ids = tokenizer(instruction, return_tensors="pt").input_ids
target_ids = model.generate(input_ids, do_sample=True, max_new_tokens=50, top_p=0.9)
# Output:
# > Write an essay about meditation. [EOI]Meditation, or yoga, is a mind/body
# method that is practiced to improve focus, reduce stress and anxiety,
# increase concentration, promote positive emotion, and enhance wellbeing.
# Meditation is an art, a meditation technique that we can take time


We provide in-depth evaluation of LongForm models and baselines in the paper. We present the METEOR scores of models in out-of-domain datasets. In all tasks, Recipe Generation (RGen), long-form question answering (ELI5), short story generation (WritingPrompts/WP), LongForm models outperform prior instruction-tuned models.

All Recipe Generation ELI5 Writing Prompts
T0++ 10.9 18.7 3.8 10.2
Tk-Instruct 6.3 12.9* 3.6 2.4
Flan-T5 10.6 20.9* 3.5 7.4
Alpaca-LLaMA-7B 14.6 19.5 12.5 11.8
OPT-30B 11.1 18.6 12.2 2.6
LongForm-T5-XL 16.3 20.2 18.3 10.6
LongForm-OPT-2.7B 17.8 15.5 17.9 19.9
LongForm-OPT-6.7B 17.7 16.9 17.2 19.0
LongForm-LLaMA-7B 19.7 21.7 18.6 18.9

Smaller versions of LongForm-OPT models are also available:

‡: We can just release the difference between LongForm-LLaMA-7B and pretrained LLaMA-7B publicly due to restrictions of LLaMA models.


The LongForm dataset and models mainly focus on long text generation and have limitations regarding structured prediction tasks in NLP. Additionally, we observe that LongForm models may present hallucination problems similar to those found in LLMs.


The LongForm project is subject to a MIT License with custom limitations for restrictions imposed by OpenAI (for the instruction generation part), as well as the license of language models (OPT, LLaMA, and T5).


      title={LongForm: Optimizing Instruction Tuning for Long Text Generation with Corpus Extraction}, 
      author={Abdullatif Köksal and Timo Schick and Anna Korhonen and Hinrich Schütze},
Downloads last month

Dataset used to train akoksal/LongForm-OPT-1.3B

Collection including akoksal/LongForm-OPT-1.3B