LLMs Usage FAQ

From LemonWiki共筆
Jump to navigation Jump to search

Common Questions and Answers about Using LLMs


🌐 Switch language: EN, 漢字


Force Traditional Chinese Output

📝 Problem: AI responses contain simplified Chinese characters

💬 Solution:

  • Add #zh-TW before your question [1]
  • Or say "Use Traditional Chinese commonly used in Taiwan"

Prompt: Icon_exclaim.gif Some models cannot distinguish the difference between Traditional Chinese and Simplified Chinese, therefore @Will_Huang suggests providing a Traditional Chinese-English bilingual vocabulary list.

```
Use Traditional Chinese commonly used in Taiwan:

Rules
- Use full-width punctuation marks and add spaces between Chinese and English text.
- Below is a common AI terminology correspondence table (English -> Traditional Chinese):
  * Transformer -> Transformer
  * Token -> Token
  * LLM/Large Language Model -> 大語言模型
  * Zero-shot -> 零樣本
  * Few-shot -> 少樣本
  * AI Agent -> AI 代理
  * AGI -> 通用人工智慧
- The following is a table of common Taiwanese terms (English -> Traditional Chinese):
  * create -> 建立
  * quality -> 質量
  * information = 資訊
  * message = 訊息
  * store = 儲存
  * search = 搜尋
  * view = 檢視, 檢視表 (No 視圖 as always)
  * create = created = 建立
  * data = 資料
  * object = 物件
  * queue = 佇列
  * stack = 堆疊
  * invocation = 呼叫
  * code = 程式碼
  * running = 執行
  * library = 函式庫
  * building = 建構
  * package = 套件
  * video = 影片
  * class = 類別
  * component = 元件
  * Transaction = 交易
  * Code Generation = 程式碼產生器
  * Scalability = 延展性
  * Metadata =  Metadata
  * Clone = 複製
  * Memory = 記憶體
  * Built-in = 內建
  * Global = 全域
  * Compatibility = 相容性
  * Function = 函式
  * document = 文件
  * example = 範例
  * blog = 部落格
  * realtime = 即時
  * document = 文件
  * integration = 整合
```

Generating Longer Article Content

📝 Problem: I want to use LLMs to generate articles of 5000-6000 words, but each attempt only produces articles of 1000-1500 words.

💬 Reason: LLM models have context window length limitations, with a fixed limit on the total number of tokens for input and output combined in each request. Therefore, each generation result encounters an upper limit of 1000-1500 words. The recommended workaround is to break down the intended article structure and generate content chapter by chapter.

Solution: If it's not possible to generate a 5000-6000 word article in one go, you can pre-plan a five-chapter structure in your input instructions, then generate content sequentially according to the chapter order, ultimately achieving the goal of producing a 5000-6000 word article.

Owl icon.jpg Using OpenAI o3 model as an example: (1) Context Window (200,000): total quota for input + output, (2) Max Output Tokens (100,000): single response limit. Actual input space: 200,000 - expected output length

How to Make AI Process Long Articles

📝 Problem: Context Length Limitations

LLM models are constrained by context window length limitations. Taking long article translation as an example, since we cannot process the entire content at once, we need to segment the article for processing.

💬 Processing Methods: Chunking and Maintaining Context Coherence Strategies

When processing long texts, we need to adopt chunking technical strategies[2]. To help the model understand the context of previous chapters when processing subsequent paragraphs, an effective approach is Chunking Strategy with Previous Article Summarization:

  1. First summarize the previous chapters
  2. Input the summary together with the full text of the next chapter to be processed to the AI
  3. This maintains context coherence while saving token usage

Overlapping Chunking Strategy

Another chunking strategy is suitable for processing transcript editing. Transcript formats typically include timestamps and corresponding subtitle content:

1
00:00:00,001 --> 00:00:02,000
So you answer me first

2
00:00:02,000 --> 00:00:06,000
Which country has left you with such a long constitutional gap

3
00:00:06,000 --> 00:00:10,000
Then tell me which country doesn't have such provisions

If segment 3 is sent directly to AI for editing, errors are likely to occur due to lack of previous dialogue context. In this case, we can adopt a content chunking strategy that "allows partial overlap." Here's an example prompt for improving Chinese transcripts[3]:

Your task is to improve Chinese spoken interview transcript paragraphs. You need to add punctuation, ensure paragraph coherence, maintain the original meaning, and rewrite portions of text as needed. Please use Traditional Chinese commonly used in Taiwan.

This is the previous paragraph:
<previous_paragraph>
{PREVIOUS_PARAGRAPH}
</previous_paragraph>

This is the current paragraph:
<current_paragraph>
{CURRENT_PARAGRAPH}
</current_paragraph>

This is the following paragraph:
<next_paragraph>
{NEXT_PARAGRAPH}
</next_paragraph>

This method allows AI to reference both preceding and following context simultaneously, ensuring coherence and accuracy in processing results.

How to Solve AI Forgetting Training Content

📝 Inquiry:

I'd like to ask a follow-up question: If we adopt a "layer-by-layer prompt optimization" approach to improve AI performance, might we encounter the following situation: After multiple rounds of prompt optimization, the AI does learn the relevant skills and performs well, but after some time, it forgets these trained capabilities?

I want to understand whether current mainstream AI model platforms all have stable memory retention capabilities - that is, can they continuously remember the training prompts and guidance we've previously provided?

Sometimes I feel that AI's memory seems unstable. During the same project, content and requirements that I've already explained to the AI in detail need to be re-explained from scratch after a while, which makes me question the continuity of AI learning.

💬 Response:

Indeed, early AI models, due to shorter context window limitations, were prone to drifting from their original settings. When I encounter such situations, I usually choose to start a completely new conversation and restart the entire interaction process.

Current AI models should have significant improvements in this regard. If this conversation's results are satisfactory, I suggest you can give the AI an instruction to summarize and consolidate the entire conversation process, integrating the accumulated interaction principles and experiences from the dialogue into the initial prompt:

Assuming I want to start a new conversation to discuss the same topic, please suggest what complete prompt I should use.

This prompt needs to include important content from our entire discussion process:
(1) The core problems and objectives that the original prompt aimed to solve
(2) Important aspects and details related to the original problem that the initial solution method didn't fully consider

Related articles

References