Token Lab검색

← 모든 연구 도구
로컬 전용 · 모델 호출 없음

프롬프트 차이와 토큰 변화

두 버전을 줄 단위로 비교하고 토큰 및 UTF-8 바이트 변화를 측정합니다.

Study guide & lesson outlineLEARNING CONTRACT

Understand → implement → investigate

Goal: explain the mechanism in this lesson, reproduce one example and test a failure case. Reading alone does not mark mastery.

01설정

02입력 추가

설정 후 예제를 불러오거나 입력을 붙여 넣으세요.

03결과 확인

설정 후 예제를 불러오거나 입력을 붙여 넣으세요.

화면은 일부만 표시할 수 있으며 JSON 보고서는 전체 계산 결과를 포함합니다.

결과 해석

A와 B를 입력하세요. 공백을 유지하며 추가·삭제 행을 표시합니다. 선택한 인코딩으로 계산하며 의미 품질을 평가하지 않습니다. 버전당 최대 20,000자와 500줄입니다.

방법 참고 자료

MATHEMATICAL REVIEW · 2026-10-26

Assumptions, implementation & acceptance

Line edits and token deltas are different quantities. Whitespace affects tokenization; a line edit is not semantic equivalence.

Reviewed counting units, statistical assumptions and numerical examples. Provider accounting and actual GPU allocation still require external measurement.

Two prompt texts → Align exact lines → Count edits separately from tokens → Inspect whitespace and template limits
Mechanism map: follow the transformations from top to bottom.

Before running: predict a boundary case

Line edits and token deltas are different quantities. Whitespace affects tokenization; a line edit is not semantic equivalence.

Hint: isolate the assumption

Keep the baseline input fixed, change one parameter or boundary, and compare both the numerical result and the claimed units. A passing example verifies this fixture only.

Minimal executable example

Save the example and linked modules in one folder. Use Node.js 22 or newer, then run node prompt-diff.mjs. npm install gpt-tokenizer@4.1.0

import {encode as rawEncode} from 'gpt-tokenizer/encoding/cl100k_base';
import {promptDiff,inspectDataset,chunkDocument,compareScores,estimateVRAM,samplingLab,speculativeLab} from './research-core.mjs';
const encode=s=>rawEncode(s,{disallowedSpecial:new Set()});
const result=promptDiff('a\nb\nc','a\nx\nc',encode);
console.log([result.inserted,result.removed,result.unchanged]); // [1,1,2]

Test and transfer

Line edits and token deltas are different quantities. Whitespace affects tokenization; a line edit is not semantic equivalence.

Record input, code version, expected result and observed result in the notebook below. Then construct a counterexample that violates the assumption above and explain why the original conclusion no longer follows.

Download complete kit (.tar.gz) · Complete reference kit and regression checks

Predict, test and keep evidence

Before revealing an answer, predict one result. After the exercise, record the discrepancy and a transfer test. Saved locally across language editions.

Open notebook / export / clear →

The mathematical review scope is recorded per lesson. It does not establish empirical paper reproduction; report suspected errors in your notes. Review scope