Errata

Generative AI Design Patterns

Errata for Generative AI Design Patterns

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Page p.132
l.17

'Before chunking the overall text surrounding the table, try to preserve the table’s metadata in the text chuck.'

the last word chuck should be changed to chunk.

HIDEMOTO NAKADA  Jan 17, 2026 
Page p.132
l.17

'Before chunking the overall text surrounding the table, try to preserve the table’s metadata in the text chuck.'

the last word chuck should be changed to chunk.

Note from the Author or Editor:
please change "chuck" in the sentence to "chunk"

HIDEMOTO NAKADA  Jan 17, 2026 
Page p. 133
l.7

You can use statistical techniques like cooccurrence analysis to bootstrap a transaction
dictionary.

'transaction' should be changed to 'translation'.

Note from the Author or Editor:
change transaction to translation

HIDEMOTO NAKADA  Jan 18, 2026 
Page p.138
l.15

See the sidebar discussion in “RAG Versus Large Context Window” on page 121, later in this chapter.

the side bar discussion is 'former in this chapter' not 'later in this chapter'.

Note from the Author or Editor:
Drop the phrase "later in this chapter"

HIDEMOTO NAKADA  Jan 18, 2026 
Page p.134
l.-3

You then embed, cluster, and summarize those, and so on until you
have just one note,

'note' should be changed to 'node'.

Note from the Author or Editor:
change note to node

HIDEMOTO NAKADA  Jan 18, 2026 
Page p.155
in the middle

How would you know that you needed to retrieve chunks related to the Nueva Planta decrees, which led to the establishment of a centralized Spanish state that was capable of driving the Nasrid rulers out of Spain?

I believe there is some cofusion. The Nasrid dinasty ended on 1492, while the Nueva Planta decees published on 1706.

Note from the Author or Editor:
Please change the text to:

How would you know that you needed to retrieve chunks related to the Catholic Monarchs whose marriage created a unified Spanish state that was capable of driving the Nasrid rulers out of Spain?

HIDEMOTO NAKADA  Jan 24, 2026 
Page p.352
step8

It is strange that while the secretary asked to **combine** the last two sentences, the writer actually **divided** the last sentence into two sentences.

Note from the Author or Editor:
Agreed.

The correct sentence should be:

"**Split the last sentence into two sentences:** This creates a stronger concluding statement, emphasizing the long-term impact."

Hidemoto Nakada  Feb 19, 2026 
Page p.366
l.3

"pretraining optimization" should be changed to "pretraining quantization" to align with the other two items.

Note from the Author or Editor:
The header of the "Pretraining" section should be "Pretraining quantization".

The paragraph below should start with "Pretraining quantization comes in two flavors. First, you can quantize the model by converting ..."

Hidemoto Nakada  Feb 20, 2026 
Page viii
1st paragraph

Inference Distribution Testing [Pattern 27] should be changed to Degradation Testing [Pattern 27]

Note from the Author or Editor:
Correct.

Inference Distribution Testing [Pattern 27] should be changed to Degradation Testing [Pattern 27]

Evan Lai  Mar 04, 2026 
Page p.39
code snipped in the middle

there is an excessive ')' in the end of the 2nd line.

input_ids = pipe.tokenizer(
input_prompt + '\n'.join(text_so_far)),
return_tensors="pt").to("cuda")

Note from the Author or Editor:
Correct code block should be:

input_ids = pipe.tokenizer(
input_prompt + '\n'.join(text_so_far),
return_tensors="pt").to("cuda")

Hidemoto Nakada  Mar 11, 2026 
Page p.40
comment in the code snippet

# count the number of words that start with desired letter
num_matches[idx] = evaluate(decoded, self.positives, self.negatives)

The comment seems to be wrong.
The code is counting the positive and negative words,
not the number of words that start with a desired letter.

Note from the Author or Editor:
Comment should be: "score description string by counting positive phrases it contains minus negative phrases"

Hidemoto Nakada  Mar 11, 2026 
Page Chap. 3 Adding Knowledge - Pattern 7 - Example
Chap. 3 Adding Knowledge - Pattern 7 - Example

The text says: "[...] by ensuring that all numerical values are on the same 0–1 scale, you enable the RAG system [...]"

But the code is using StandardScaler (from sklearn.preprocessing import StandardScaler) which actually normalizes to mean=0 and variance=1. Which means values will be outside the 0-1 range.

I think the code is correct but the text is wrong.

Note from the Author or Editor:
Actually, the code should be updated.

def encode_numeric_data(numeric_data):
# Normalize numeric values to 0-1 range
scaler = MinMaxScaler()
normalized_numeric = scaler.fit_transform(numeric_data)
return normalized_numeric

Lorenzo Cesconetto  Mar 12, 2026 
Page Chap 3 - Pattern 7 - Solution - Hierarchical chunking (alternative chunking techniques)
Chap 3 - Pattern 7 - Solution - Hierarchical chunking (alternative chunking techniques)

"You then embed, cluster, and summarize those, and so on until you have just one note, [...]"

It should be "node" instead of "note".

Note from the Author or Editor:
The sentence should be:

"You then embed, cluster, and summarize those, and so on until you have just one node"

Lorenzo Cesconetto  Mar 12, 2026 
Page Chap 3 - Pattern 6 - Solution - Retrieval
Chap 3 - Pattern 6 - Solution - Retrieval

The equation for TF-IDF is wrong.
It's dividing TF by IDF instead of multiplying.

TF = count(term,chunk)/∑ term count(term,chunk)
IDF = log(count(chunk) / count(chunk | term ∈ chunk))

It should be TF x IDF, but the book does TF / IDF in the equation

Note from the Author or Editor:
It is a typo, the terms (nominator and denominator) should be multiplied

Lorenzo Cesconetto  Mar 12, 2026 
Page 174
the second-to-last paragraph

Because the core of Node Preprocessing is reranking, this ... should be changed to Because the core of Node Postprocessing is reranking, this ...

Note from the Author or Editor:
Correct.

Node Preprocessing should be changed to "Node Postprocessing"

Evan Lai  Mar 04, 2026 
Page 248
2nd paragraph

"quantization-aware low-rank adaptation" should be changed to "quantization low-rank adaptation"(based on the index and information from the web).

Note from the Author or Editor:
Agreed.

"quantization-aware low-rank adaptation" should be changed to "quantization low-rank adaptation"

Evan Lai  Mar 04, 2026 
Page 374
the third-to-last paragraph

The text mentions “compared to higher-precision formats (like 1-bit integer).” Why is a 1-bit integer considered a higher-precision format? Isn’t it the lowest precision?

Note from the Author or Editor:
The sentence should end in "but it typically results in more significant accuracy degradation compared to higher-precision formats (like 32-bit floats)."

Evan Lai  Mar 04, 2026 
Page 420
1st paragraph of Summary section

Inference Distribution Testing should be changed to Degradation Testing

Note from the Author or Editor:
Yes, it is a typo.

The sentence should be "The section on Degradation Testing (Pattern 27) provides metrics needed to validate ..."

Evan Lai  Mar 04, 2026 
Page 450
table caption

It's "Table 9-2. Patterns for 'teaching capability'", however, this is a chapter about Safeguards.

Note from the Author or Editor:
For clarity, the table description should be "Table 9-2. Patterns for 'Safeguards'"

Evan Lai  Mar 04, 2026