﻿# ProGen2 context is a protein-sequence prefix, not a chat instruction

Distinguish ProGen2 sequence continuation, tokenizer boundary markers, generated-output truncation, and shifted likelihood scoring from conversational prompting.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-progen2-sequence-context-continuation-likelihood/
Language: en

## A context argument does not imply a chat interface

A generic model gateway may expose a prompt field and connect it to ProGen2. That field should retain the meaning of the underlying sequence model. A request written in ordinary conversational language is not equivalent to a protein prefix in the documented vocabulary.

The [ProGen2 release guide](https://raw.githubusercontent.com/salesforce/progen/main/progen2/README.md) presents sequence sampling and likelihood evaluation. An adapter should name those operations directly rather than borrowing chat roles that the checkpoint interface does not define.

## Tokenizer markers belong to the sequence protocol

The [sampling implementation](https://raw.githubusercontent.com/salesforce/progen/main/progen2/sample.py) loads a custom tokenizer, encodes the context, and decodes generated sequences. It also truncates outputs at sequence boundary markers. Those markers are not ordinary amino-acid content.

Preserve raw decoded output separately from the extracted biological sequence. If an exporter removes markers, retain the extraction rule and termination reason. A sequence that stopped at a boundary and one that reached a configured length limit represent different generation outcomes.

## Continuation length needs an interface definition

A framework generation parameter may describe a total sequence limit rather than a budget for newly generated content. The supplied prefix can therefore affect how much continuation remains available under that limit.

Record encoded prefix length and the actual completion extent. The [token-budget guide](/journal/tensor-axes-batch-sequence-hidden/) helps distinguish model sequence positions from user-facing text length. Avoid reporting a configured limit as if it were the number of newly generated amino acids.

## Likelihood aligns predictions with later tokens

The [likelihood implementation](https://raw.githubusercontent.com/salesforce/progen/main/progen2/likelihood.py) shifts logits and targets for causal scoring. A custom scorer must preserve that alignment and state whether it aggregates by a sum or mean over the selected domain.

A score without its boundary-token treatment, normalization, and sequence direction is incomplete. Do not compare differently normalized values as though they were identical estimates, especially when candidate lengths differ.

## A model result remains a computational candidate

Test the adapter on short inspected inputs, checking vocabulary, boundaries, prefix preservation, and score alignment before processing a collection. Keep checkpoint and tokenizer revisions linked to the extracted sequence artifact.

The [artifact validation guide](/journal/safetensors-artifact-validation/) explains that bundle identity. Sequence likelihood and successful generation do not establish experimental folding, activity, or suitability of the output for any particular biological application.
