Skip to content
The Chat Archive
claude-opus-4-20250514-thinking-16k· Anthropic LMArena Human Preference 140K

What is the structure of an Unsloth AI train.jsonl?

  1. User

    What is the structure of an Unsloth AI train.jsonl?

  2. Assistant

    A train.jsonl file for Unsloth AI typically follows a JSON Lines format where each line is a separate JSON object representing a training example. The exact structure can vary depending on the model and task, but here are the most common formats:

    Standard Instruction Format

    {"instruction": "Write a poem about the ocean", "input": "", "output": "The waves crash upon the shore..."}
    {"instruction": "Translate to French", "input": "Hello, how are you?", "output": "Bonjour, comment allez-vous?"}
    

    Conversational/Chat Format

    {"conversations": [{"from": "human", "value": "What is the capital of France?"}, {"from": "assistant", "value": "The capital of France is Paris."}]}
    {"conversations": [{"from": "human", "value": "Explain photosynthesis"}, {"from": "assistant", "value": "Photosynthesis is the process by which plants..."}]}
    

    Alternative Chat Format

    {"messages": [{"role": "user", "content": "What is 2+2?"}, {"role": "assistant", "content": "2+2 equals 4."}]}
    {"messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello"}, {"role": "assistant", "content": "Hello! How can I help you today?"}]}
    

    Key points about the structure:

    • Each line must be valid JSON
    • Common fields include instruction/input/output or conversations/messages
    • The "input" field can be empty if not needed
    • Multi-turn conversations are supported in chat formats
    • System prompts can be included in some formats

    The specific format you should use depends on the model template and your use case. Unsloth supports various popular formats including Alpaca, ChatML, and others.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.