Answers are the first type of human behaviour the Semilattice API can simulate. Simulating an answer with the API means predicting how a specific population, defined by a population model, would respond to a question.

Key concepts

Population-level predictions

Answers represent how a population would respond to questions, not individual people. You’ll never see simulated responses from specific individuals - only aggregated percentages showing how the group as a whole would distribute across answer options.

{
  "simulated_answer_percentages": {
    "Very satisfied": 0.34,
    "Somewhat satisfied": 0.41,
    "Neutral": 0.15,
    "Somewhat dissatisfied": 0.07,
    "Very dissatisfied": 0.03
  }
}

Answer management

The Answers section in your dashboard shows all questions you’ve simulated across different populations. Each row represents a unique question-population combination, allowing you to track and compare predictions over time.

Question types

The API supports three types of questions:

Single-Choice

Simulates respondents selecting exactly one option from a list of choices.

Multiple-Choice

Simulates respondents selecting multiple options from a list of choices.

Open-Ended

Respondents provide free-text answers. Currently in alpha!

Two types of answer prediction

Simulate answers

When you want to predict how a population would respond to new questions:

  • Use the answers.simulate() method
  • Accuracy can only be estimated from the population’s test results
  • Enables use cases which rely on knowing things you currently don’t know about the population

Benchmark answers

When you want to test a population against questions with known answers:

  • Use the answers.benchmark() method
  • Compares predictions to ground truth data, generating accuracy metrics
  • Enables you to test population models on new kinds of questions

Question format examples

Single-choice

{
  "question": "What's your primary programming language?",
  "question_options": { "question_type": "single-choice" },
  "answer_options": ["Python", "JavaScript", "Java", "Go", "Rust"]
}

Multiple-choice

{
  "question": "Which development tools do you use regularly?",
  "question_options": { "question_type": "multiple-choice" },
  "answer_options": ["VS Code", "Git", "Docker", "Kubernetes", "AWS"]
}

Open-ended

{
  "question": "What's the biggest challenge in software development?",
  "question_options": { "question_type": "open-ended" }
}

Answer response structure

All answer predictions follow a consistent structure, whether simulated or benchmarked:

{
  "data": {
    "id": "answer-uuid",
    "population": "population-uuid",
    "question": "Your question text",
    "answer_options": ["Option 1", "Option 2"],
    "status": "Predicted",
    "simulated_answer_percentages": { "Option 1": 0.6, "Option 2": 0.4 },
    "ground_answer_percentages": null, // Only populated for benchmarks
    "accuracy": null, // Only populated for benchmarks
    // ... other fields
  }
}

Next steps