<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ko">
	<id>http://junhoahn.kr/noriwiki/index.php?action=history&amp;feed=atom&amp;title=Time_between_token</id>
	<title>Time between token - 편집 역사</title>
	<link rel="self" type="application/atom+xml" href="http://junhoahn.kr/noriwiki/index.php?action=history&amp;feed=atom&amp;title=Time_between_token"/>
	<link rel="alternate" type="text/html" href="http://junhoahn.kr/noriwiki/index.php?title=Time_between_token&amp;action=history"/>
	<updated>2026-04-12T15:29:35Z</updated>
	<subtitle>이 문서의 편집 역사</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://junhoahn.kr/noriwiki/index.php?title=Time_between_token&amp;diff=2016&amp;oldid=prev</id>
		<title>Ahn9807: 새 문서: 분류: 인공지능  == 개요 == Time between token(TBT)는 LLM의 성능을 평가하는 지표중 하나로, 모델이 첫번째 토큰을 생성한후(TTFT)각 후속 토큰을 생성하는 데 걸리는 평균 시간을 의미한다.  TBT는 다음과 같이 정의된다: TBT = &lt;math&gt;\frac{T_{\text{total}} - T_{\text{first}}}{N - 1}&lt;/math&gt; 여기서, * &lt;math&gt;T_{\text{total}}&lt;/math&gt; = 전체 응답 생성 시간 * &lt;math&gt;T_{\text{first}}&lt;/math&gt; = 첫 번째 토...</title>
		<link rel="alternate" type="text/html" href="http://junhoahn.kr/noriwiki/index.php?title=Time_between_token&amp;diff=2016&amp;oldid=prev"/>
		<updated>2025-03-27T05:46:53Z</updated>

		<summary type="html">&lt;p&gt;새 문서: &lt;a href=&quot;/noriwiki/index.php?title=%EB%B6%84%EB%A5%98:%EC%9D%B8%EA%B3%B5%EC%A7%80%EB%8A%A5&quot; title=&quot;분류:인공지능&quot;&gt;분류: 인공지능&lt;/a&gt;  == 개요 == Time between token(TBT)는 &lt;a href=&quot;/noriwiki/index.php?title=LLM&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;LLM (없는 문서)&quot;&gt;LLM&lt;/a&gt;의 성능을 평가하는 지표중 하나로, 모델이 첫번째 토큰을 생성한후(&lt;a href=&quot;/noriwiki/index.php?title=TTFT&quot; class=&quot;mw-redirect&quot; title=&quot;TTFT&quot;&gt;TTFT&lt;/a&gt;)각 후속 토큰을 생성하는 데 걸리는 평균 시간을 의미한다.  TBT는 다음과 같이 정의된다: TBT = &amp;lt;math&amp;gt;\frac{T_{\text{total}} - T_{\text{first}}}{N - 1}&amp;lt;/math&amp;gt; 여기서, * &amp;lt;math&amp;gt;T_{\text{total}}&amp;lt;/math&amp;gt; = 전체 응답 생성 시간 * &amp;lt;math&amp;gt;T_{\text{first}}&amp;lt;/math&amp;gt; = 첫 번째 토...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;새 문서&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[분류: 인공지능]]&lt;br /&gt;
&lt;br /&gt;
== 개요 ==&lt;br /&gt;
Time between token(TBT)는 [[LLM]]의 성능을 평가하는 지표중 하나로, 모델이 첫번째 토큰을 생성한후([[TTFT]])각 후속 토큰을 생성하는 데 걸리는 평균 시간을 의미한다.&lt;br /&gt;
&lt;br /&gt;
TBT는 다음과 같이 정의된다:&lt;br /&gt;
TBT = &amp;lt;math&amp;gt;\frac{T_{\text{total}} - T_{\text{first}}}{N - 1}&amp;lt;/math&amp;gt;&lt;br /&gt;
여기서,&lt;br /&gt;
* &amp;lt;math&amp;gt;T_{\text{total}}&amp;lt;/math&amp;gt; = 전체 응답 생성 시간&lt;br /&gt;
* &amp;lt;math&amp;gt;T_{\text{first}}&amp;lt;/math&amp;gt; = 첫 번째 토큰이 생성되기까지 걸린 시간 (Time to First Token, TTFT)&lt;br /&gt;
* N = 전체 토큰 수&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
import time  &lt;br /&gt;
import openai  &lt;br /&gt;
&lt;br /&gt;
response = openai.ChatCompletion.create(model=&amp;quot;gpt-4&amp;quot;, messages=[{&amp;quot;role&amp;quot;: &amp;quot;user&amp;quot;, &amp;quot;content&amp;quot;: &amp;quot;Explain quantum mechanics&amp;quot;}], stream=True)  &lt;br /&gt;
&lt;br /&gt;
first_token_time = None  &lt;br /&gt;
previous_token_time = None  &lt;br /&gt;
token_intervals = []  &lt;br /&gt;
&lt;br /&gt;
for chunk in response:  &lt;br /&gt;
    if chunk[&amp;quot;choices&amp;quot;][0][&amp;quot;delta&amp;quot;]:  &lt;br /&gt;
        current_time = time.time()  &lt;br /&gt;
        if first_token_time is None:  &lt;br /&gt;
            first_token_time = current_time  &lt;br /&gt;
        else:  &lt;br /&gt;
            if previous_token_time is not None:  &lt;br /&gt;
                token_intervals.append(current_time - previous_token_time)  &lt;br /&gt;
            previous_token_time = current_time  &lt;br /&gt;
&lt;br /&gt;
avg_tbt = sum(token_intervals) / len(token_intervals) if token_intervals else None  &lt;br /&gt;
print(f&amp;quot;Average TBT: {avg_tbt:.3f} seconds&amp;quot;)  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ahn9807</name></author>
	</entry>
</feed>