Loading...
Loading...
You are building an AI assistant configuration system. The system needs to automatically select the most appropriate prompting strategy for a given task based on specific characteristics. The three strategies available are:
k example input-output pairs before the actual query. Use when the task involves a specific format, pattern recognition, or domain-specific output style.Given a list of task descriptors, classify each task into one of the three prompting strategies: "zero-shot", "few-shot", or "chain-of-thought".
Each task is represented as a list of integer feature flags:
features[0]: 1 if the task requires multi-step reasoning, else 0features[1]: 1 if the task involves a specific output format or style, else 0features[2]: 1 if the task is a well-known, general-knowledge query, else 0features[3]: 1 if the task involves mathematical or logical computation, else 0Classification Rules (in priority order):
features[0] == 1 OR features[3] == 1 → "chain-of-thought"features[1] == 1 → "few-shot""zero-shot"tasks: a list of n tasks, where each task is a list of exactly 4 integers (each 0 or 1)Return a list of n strings, where each string is the recommended prompting strategy for the corresponding task.
Input: tasks = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0]]
Output: ["chain-of-thought", "few-shot", "zero-shot"]
Explanation:
features[0] == 1 → multi-step reasoning required → "chain-of-thought"features[1] == 1 → specific format needed → "few-shot"1 <= n <= 10^4 Each task is a list of exactly 4 integers Each feature flag is either 0 or 1 All tasks[i].length == 4
features[2] == 1"zero-shot"Input: tasks = [[0, 0, 0, 1], [0, 1, 1, 0]]
Output: ["chain-of-thought", "few-shot"]
Explanation:
features[3] == 1 → mathematical computation → "chain-of-thought" (Rule 1 takes priority)features[1] == 1 and features[2] == 1 but no reasoning/math flags → "few-shot" (Rule 2)Input: tasks = [[1, 1, 0, 1]]
Output: ["chain-of-thought"]
Explanation:
features[0] and features[3] → Rule 1 applies first → "chain-of-thought"