Kiến thức cần nắm:
Common Issue: Context window overflow xảy ra khi input + context vượt quá giới hạn tokens của model. Giải pháp: dynamic chunking, prompt compression, hoặc chọn model có context window lớn hơn.
Giải thích chi tiết:
Context Window Overflow Troubleshooting:
| Symptom | Nguyên nhân | Giải pháp |
|---|---|---|
ValidationException | Input vượt context limit | Giảm input size, chọn model lớn hơn |
| Truncated responses | max_tokens quá thấp | Tăng max_tokens |
| Missing context | RAG trả về quá nhiều chunks | Giảm numberOfResults, improve chunking |
| Irrelevant responses | Context không liên quan | Improve retrieval, better chunking |
Dynamic Chunking Strategies:
| Strategy | Mô tả | Best For |
|---|---|---|
| Fixed-size | Chia theo số characters/tokens | Simple documents |
| Semantic | Chia theo meaning boundaries | Complex documents |
| Hierarchical | Parent-child chunks | Structured documents |
| Sliding window | Overlapping chunks | Continuous text |
Kiến thức cần nắm:
Giải thích chi tiết:
Common Bedrock API Errors:
| Error Code | Mô tả | Giải pháp |
|---|---|---|
ThrottlingException | Rate limit exceeded | Implement exponential backoff |
ValidationException | Invalid request format | Check request body format |
ModelTimeoutException | Model took too long | Reduce input size, use streaming |
AccessDeniedException | IAM permission issue | Check IAM policies |
ServiceUnavailableException | Service issue | Retry with backoff, try another region |
ModelNotReadyException | Model not available | Check model access, region availability |
Debugging Checklist:
Kiến thức cần nắm:
Giải thích chi tiết:
Prompt Debugging Process:
Common Prompt Issues:
| Issue | Symptom | Fix |
|---|---|---|
| Ambiguous instructions | Inconsistent outputs | Be more specific |
| Missing context | Hallucination | Add relevant context |
| Conflicting instructions | Confused responses | Simplify, prioritize |
| Too many constraints | Refusal to answer | Relax constraints |
| Wrong format | Unstructured output | Add format examples |
Kiến thức cần nắm:
Giải thích chi tiết:
RAG Troubleshooting Flow:
Poor response quality
↓
Is retrieval returning relevant docs?
├── No → Fix retrieval
│ ├── Check embedding quality
│ ├── Improve chunking strategy
│ ├── Tune search parameters
│ └── Add metadata filters
└── Yes → Fix generation
├── Improve prompt template
├── Add instructions for using context
└── Tune model parameters
Embedding Quality Diagnostics:
Kiến thức cần nắm:
Giải thích chi tiết:
Prompt Maintenance Best Practices: