Zenaique

ShareGPT format: what data shape does it use?

MCQ·Easy·4.0 · 0·~1 min·Asked atAndurilStripeUipath·Relevant atDatabricks
Attempt it
TL;DR

ShareGPT is multi-turn dialogues stored as a `conversations` array of `{from, value}` objects, where `from` is `human` or `gpt` and `value` is the turn text.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine someone installed a browser extension that captured every chat they had with an AI assistant and let them share the full back and forth with the world. Each shared file is one whole conversation, not just a single question and answer. Inside, the turns are listed in order, and each turn is tagged with who was talking. The two tags borrow the platform's own vocabulary: human for the person typing and gpt for the assistant responding. That captured-conversation shape is the ShareGPT format. The name is literal: people were sharing their GPT conversations, and the file shape mirrors what the extension exported.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

ShareGPT is one of the most consequential community dataset formats in the modern LLM era. A large fraction of the early open-weight instruction-tuned models, Vicuna, WizardLM, and many others, trained on cleaned ShareGPT data. The format's quirks (the unusual from / value schema, the human / gpt role labels) reflect its origin as browser-extension exports of ChatGPT conversations, not as a deliberately designed training schema.

This deep dive walks through the structure of a ShareGPT example, traces the historical context that produced the format, surveys the tooling ecosystem that consumes it, and contrasts it cleanly with the adjacent formats (Alpaca, OpenAI chat, DPO preference) that get confused with it.

The headline shape is straightforward. Each example is one full multi-turn dialogue. The top-level key is conversations. The value is an array of turn objects, each with two fields: from (the speaker, either human or gpt, with system as an optional leading turn) and value (the text of that turn). That is the entire schema.

The reason to know this format in 2026, even though the OpenAI chat-completions shape has largely taken over as the lingua franca, is that an enormous quantity of existing open-weight training data is in ShareGPT format. Every major training stack still supports it as a first-class input shape, converting to the standard messages format internally. Reading a Hugging Face dataset card that says "ShareGPT format" and knowing exactly what that means without looking it up is foundational community literacy.

The schema and the role labels

Top-level structure

One example per record. The top-level key is conversations (sometimes conversation in older or alternate variants). Its value is an array of turn objects representing the full multi-turn dialogue.

A single record holds one complete conversation. There is no notion of separating prompt from completion; the conversation is the unit, and the trainer's job is to apply masking based on speaker roles.

The inner schema

Each turn object has exactly two fields:

  • from: a string identifying the speaker. Standard values are human (the user) and gpt (the assistant). Some variants include system for a leading behavioural setup turn.
  • value: a string containing the actual text of that turn.

No other fields. No timestamps, no IDs, no metadata. The format is deliberately minimal.

Why these specific role labels

The role labels are borrowed directly from the ChatGPT browser-extension export format. Users were typing (human), the GPT model was responding (gpt). When the early open-weight community started training on these exports, they kept the field names rather than normalising to user and assistant.

By the time the OpenAI chat-completions schema (with role and content and system / user / assistant role values) took over as the modern standard, ShareGPT was already entrenched in dataset cards and training pipelines. The labels persisted out of inertia, and modern tooling now treats human and gpt as aliases for user and assistant during conversion.

A concrete example

code
{"conversations": [
  {"from": "system", "value": "You are a helpful coding assistant."},
  {"from": "human", "value": "Write a Python function to reverse a list."},
  {"from": "gpt", "value": "def reverse_list(lst):\n    return lst[::-1]"},
  {"from": "human", "value": "Now make it work for tuples too."},
  {"from": "gpt", "value": "def reverse_seq(seq):\n    return seq[::-1]"}
]}

A four-turn conversation (one system, two human, two gpt) packed into one JSON object.

Where the format came from
Tooling and conversion to the standard chat format
How ShareGPT differs from adjacent formats
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
FormatMulti-turnRole fieldRole values
ShareGPTYesfromhuman, gpt, (system)
OpenAI chatYesrolesystem, user, assistant, tool
AlpacaNo (single-turn)N/A (flat fields)N/A
DPO preferenceNo (response pair)N/AN/A

Real products, models, and research that use this idea.

  • Vicuna (LMSys, 2023) was trained on around 70k cleaned ShareGPT dialogues, becoming the first major open chat-tuned model that approached ChatGPT quality.
  • WizardLM's early releases blended ShareGPT data with synthetic instruction-evolution data using the same conversations schema.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow does a training stack convert ShareGPT to the standard chat format?
A

Three substitutions: top-level key conversations to messages, inner key from to role with values human mapped to user and gpt mapped to assistant, and inner key value to content. Most tooling does this in a single map function.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Confusing ShareGPT with Alpaca. Alpaca is single-turn flat fields (instruction, input, output); ShareGPT is multi-turn dialogues as a conversations array of {from, value} objects.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • The top-level key and the inner schema of ShareGPT

  • The two role-equivalent values in the from field

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is RLHF, and why is it used after pretraining?
MCQ·Easy