Description
Return top-k score indexes with a boundary-tie policy.
Language-model bookkeeping separates scores, probabilities, dimensions, capacity and positional transforms. A local ranking, padding or coordinate operation can illustrate a model component without running a model, sampling a token, fitting calibration or demonstrating output quality.
Return top-k score indexes with a boundary-tie policy.
When to use this tool
Use Artificial Intelligence: Topk Boundary Tie Policy when checking the stated model-dimension, ranking, probability-prefix or local transform convention.
How to use the tool and how it works
- Enter scores, k, tiePolicy. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Return top-k score indexes with a boundary-tie policy. Require nonempty scores, whole k within length and stable-index/include-all policy; sort descending with lower index first on ties, return first k or all scores at least the kth score.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| scores | Scores | Required. Array of finite number. Implementation limit: 128 items. |
| k | K | Required. Safe integer. Calculation range: 1 through scores.length, inclusive. |
| tiePolicy | Tie Policy | Required. Text; one of "stable-index", "include-all". Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Returned calculated value or nested object under the stated output convention. | Required. Object. |
| result.selectedIndices | Selected Indices | Calculated result member: array. |
| result.boundaryScore | Boundary Score | Calculated result member: number. |
| result.tiedBoundaryIndices | Tied Boundary Indices | Calculated result member: array. |
{
"input": {
"scores": [
4,
3,
3,
1
],
"k": 2,
"tiePolicy": "include-all"
},
"output": {
"result": {
"selectedIndices": [
0,
1,
2
],
"boundaryScore": 3,
"tiedBoundaryIndices": [
1,
2
]
}
}
} Limitations and assumptions
- Include-all may return more than k; scores need not be probabilities and no sampling or model inference is performed.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use a complete implementation with verified tensor/token conventions and appropriate model evaluation when actual inference, memory, sampling or quality results are required.
References
Similar or alternative tools
- Token Probability Rank Margin
Return a token's competition rank and next-distinct probability margin.
- Top P Boundary Token Residual Mass Tool
Find the smallest descending-probability nucleus reaching a supplied top-p threshold, including its boundary token.