Use Case Taxonomy
A systematic classification of generative AI patterns for software development and content creation.
Overview
- ๐ฆ Basic Patterns โ Foundational generation patterns: creation, transformation, and synthesis
- ๐ Advanced Patterns โ Incremental, hierarchical, and iterative generation strategies
- ๐ง Combined Workflows โ Real-world pipelines combining multiple patterns
Basic Generative Use Cases
0 โ 1: Content Creation (Foundational)
Generate new content from scratch based on descriptions or prompts.
Description โ LLM โ Generated File
"Create a REST API for user management" โ LLM โ UserController.kt
Examples:
- Generate file from description
- Generate images from text prompts
- Create boilerplate code from specifications
- Generate documentation from requirements
1 โ 1: Content Transformation (Transform)
Transform existing content while preserving its essential meaning or structure.
Input โ Transform โ Output
Examples:
- Summarization of articles
- Translation between languages
- Edit / feature addition to existing code files
- Code refactoring and optimization
(A + B + โฆ) โ C: Synthesis (Combine)
Combine multiple inputs to create unified, coherent output.
[A, B, C] โ Synthesize โ Result
Examples:
- Synthesis by Example: Generate new content based on multiple input examples
- Pattern Extraction: Identify common patterns from multiple inputs
- Mass Summarization: Summarize multiple documents into a single cohesive summary
(A โ B + C) โ D: Analogical Generation (Advanced)
Create new content by combining and modifying existing pieces through analogy.
A โ B + C โ D
Concept: Transfer features from one class/file to another โ a sort of "transgenic" content generation.
UserService (A) - BasicCRUD (B) + CachingLayer (C) โ CachedUserService (D)
Advanced Generative Use Cases
A โ A + ฮด: Incremental Generation (Extend)
Generate additions to existing content, continuing from where it left off.
Existing (A) โ Continue โ Extended (A + ฮด)
Key Insight: Essentially telling the model to "continue" from where it left off, useful for long-form content generation.
Hierarchical Generation (Scale)
Generate complex content through multiple stages of refinement and transformation.
Spec
โโโ Module A
โ โโโ File 1
โ โโโ File 2
โโโ Module B
โ โโโ File 3
โ โโโ File 4
โโโ Module C
โโโ File 5
โโโ File 6
Key Insight: Allows for exponential growth in content volume. LLM output is generally constrained by input size, but hierarchical generation bypasses this limitation.
Applications:
- Spec-driven development
- Large codebase generation
- Documentation hierarchies
Iterative Editing (Refine)
Repeatedly refine content through multiple editing passes.
Aโ โ Edit โ Aโ โ Edit โ Aโ โ ... โ Aโ
Considerations:
- Patching Strategy: Full replacement vs. modification of existing content
- Convergence: Monitor for stability and diminishing returns
- Quality Gates: Define stopping criteria
Error Correction (Fix)
Identify and correct errors using a feedback loop with external validation.
Code โ Validator (Tests / Linter)
โ Fail โ Fix โ (loop back to Validator)
โ
Pass โ Done
Considerations:
- May require many iterations to achieve desired quality
- Periodic human interventions may be necessary
- Set maximum iteration limits to prevent infinite loops
Combined Workflows
Real-world workflows often combine multiple patterns to achieve complex goals.
Example: Spec-Driven Development Pipeline
Spec โ (Modules) [Hierarchical]
โ
Each Module โ Code [0โ1 Creation]
โ
Code โ Tests [1โ1 Transformation]
โ
while(tests fail) โ Fix [Error Correction]
Quick Reference
| Pattern | Notation | Use Case | Cognotik Task |
|---|---|---|---|
| Content Creation | 0 โ 1 |
Generate new files from descriptions | FileTask |
| Transformation | 1 โ 1 |
Edit, refactor, translate | EditTask |
| Synthesis | (A+B+...) โ C |
Combine multiple inputs | InquiryTask |
| Analogical | (AโB+C) โ D |
Feature transfer | EditTask |
| Incremental | A โ A+ฮด |
Continue/extend content | FileTask |
| Hierarchical | A โ (B,C); ... |
Multi-stage generation | TaskPlanningTask |
| Iterative | for(1..n) A โ A |
Repeated refinement | EditTask |
| Error Correction | while(fail) fix |
Validation-driven fixes | RunShellCommandTask |