liveBook · Manning

Prompt language model

As explained in Building LLM Applications with DSPy

A language model assigned to generate candidate instructions during prompt optimization.

A prompt language model generates candidate instructions during optimization. A separate task model evaluates those candidates and handles production requests, so a more capable, potentially more expensive model can be reserved for the less frequent optimization calls. MIPROv2 can also use the task model for instruction proposals when no separate prompt model is specified. section 6.1.4 section 6.2

Listing 6.3 Using the COPRO optimizer with prompt_lm
lm_5 = dspy.LM(model='gpt-5', temperature=1.0, max_tokens=30000)
copro = dspy.COPRO(prompt_model=lm_5, init_temperature=1.0,
                   metric=validate_answer, 
                   breadth=2, depth=2, track_stats=True)
prog_copro_2 = copro.compile(intent_classifier, trainset=val_set,
                             eval_kwargs={"num_threads": 3,
                             'display_progress': True})

This COPRO configuration assigns GPT-5 to propose instructions during compilation. section 6.1.4

How Building LLM Applications with DSPy covers it

How deep it goes
Defines its optimization-only role and gives call-frequency and configuration guidance, without detailing model internals.
Examples
Uses GPT-5 as the COPRO prompt model and gpt-4o-mini as the task model.
What you can do after
Apply it by assigning a separate model to propose instructions during COPRO compilation while retaining the task model for evaluation and production.
How it connects
Links instruction generation to prompt optimization, task language models, COPRO, MIPROv2, and BootstrapFewShot.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building LLM Applications with DSPy. The section links point to the parts of the book it draws on.