Skip to contents

A four-stage orchestration:

Usage

think_harder(
  problem,
  strong_config,
  cheap_config,
  n_approaches = 4L,
  verify = TRUE,
  quiet = FALSE,
  ...
)

Arguments

problem

The problem statement (character scalar). Be complete: workers see nothing but this and their assigned approach.

strong_config

An LLMR::llm_config() for the strong (planner / synthesizer / verifier) model.

cheap_config

An LLMR::llm_config() for the cheap worker model.

n_approaches

Number of independent lines of attack (default 4).

verify

If TRUE (default), run the verification stage and one revision round when the verifier finds a substantive flaw.

quiet

FALSE prints stage progress.

...

Passed to LLMR::call_llm_par() for the worker stage (e.g. tries, progress).

Value

A list of class super_brain:

answer

The final answer (character).

plan

Tibble of approaches: title, instructions.

workers

Tibble: approach, output, success, plus token diagnostics from LLMR::call_llm_par().

verification

The verifier's structured critique (or NULL).

revised

TRUE when the revision pass ran.

Details

  1. Plan (strong model, 1 call): decompose the problem into n_approaches genuinely different lines of attack.

  2. Work (cheap model, n_approaches parallel calls): each line is pursued independently, blind to the others.

  3. Synthesize (strong model, 1 call): weigh the drafts against one another, resolve contradictions, and write the answer.

  4. Verify (strong model, 1 call, optional): attack the synthesized answer; if a real flaw is found, one revision pass runs.

The economics: two to three strong-model calls regardless of how wide the fan-out is, with the bulk of tokens billed at the cheap model's rate. The returned object keeps every intermediate product, so you can audit what each worker contributed and what the verifier objected to.

Examples

if (FALSE) { # \dontrun{
strong <- LLMR::llm_config("deepseek", "deepseek-reasoner")
cheap  <- LLMR::llm_config("groq", "openai/gpt-oss-20b", temperature = 0.8)
out <- think_harder(
  "A city of 1M residents wants to halve traffic deaths in 5 years
   with a budget of $40M. Propose the most cost-effective portfolio
   of interventions, with rough numbers.",
  strong_config = strong, cheap_config = cheap, n_approaches = 5
)
cat(out$answer)
out$workers[, c("approach", "success")]
} # }