-


Fichier Détails

Cartes-fiches 368
Langue Français
Catégorie Informatique
Niveau Université
Crée / Actualisé 31.05.2025 / 09.06.2025
Lien de web
https://card2brain.ch/box/20250531_maio
Intégrer
<iframe src="https://card2brain.ch/box/20250531_maio/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>

What is Fine-tuning vs Prompt Engineering ? 

Fine-tuning trains models on specific data to specialize behavior, while prompt engineering achieves customization through input design without model modification. Prompt engineering is faster, cheaper, and more accessible. Fine-tuning offers deeper customization but requires significant resources and expertise.

What is Ai vs AGI ? 

AI (Artificial Intelligence) refers to systems that perform specific tasks intelligently, while AGI (Artificial General Intelligence) represents hypothetical AI with human-level reasoning across all domains. Current LLMs are narrow AI - powerful at language tasks but lacking true understanding or general intelligence like AGI would possess.

What is RAG ? 

Retrieval-Augmented Generation (RAG) combines LLMs with external knowledge retrieval to ground responses in verified, current information. RAG retrieves relevant documents before generating responses, reducing hallucinations and enabling access to information beyond the model's training cutoff. This approach improves accuracy and provides source attributio

What is temperature ? 

Temperature controls the randomness in token selection during text generation. Lower values (0-0.3) produce deterministic, factual outputs. Medium values (0.5-0.7) balance creativity and coherence. Higher values (0.8-1.0) generate creative, diverse outputs but may be less coherent. Use low temperature for math/facts, high for creative writing.

What is Top-K ?

Top-K

Top-K restricts token selection to the K most likely tokens from the probability distribution. Low values (1-10) produce conservative, factual outputs. Medium values (20-50) balance creativity and quality. High values (50+) enable diverse, creative outputs. Use low K for technical tasks, high K for creative writing

What is Top-P ? 

Top-P (nucleus sampling) selects tokens from the smallest set whose cumulative probability exceeds threshold P. Unlike Top-K's fixed number, Top-P dynamically adjusts based on probability distribution. Low values (0.1-0.5) produce focused outputs, medium (0.6-0.9) balance creativity and coherence, high (0.9-0.99) enable creative diversity.

What is Stop Sequences ? 

Stop sequences are specific strings that signal the LLM to stop generating text when encountered, providing precise control over output length and format. Common examples include newlines, periods, or custom markers like "###" or "END". This parameter is particularly useful for structured outputs, preventing models from generating beyond intended boundaries. Stop sequences are essential for ReAct prompting and other scenarios where you need clean, precisely bounded responses. They offer more control than max tokens by stopping at logical breakpoints rather than arbitrary token limits

What is Max Tokens ? 

Max tokens setting controls the maximum number of tokens an LLM can generate in response, directly impacting computation cost, response time, and energy consumption. Setting lower limits doesn't make models more concise—it simply stops generation when the limit is reached. This parameter is crucial for techniques like ReAct where models might generate unnecessary tokens after the desired response. Balancing max tokens involves considering cost efficiency, response completeness, and application requirements while ensuring critical information isn't truncated.

What are the prompting techniques ? 

Zero-Shot Prompting

One-Shot & Few-Shot Prompting

Step-Back Prompting

Chain of Thought (CoT) Prompting

Self-Consistency Prompting

Tree of Thoughts (ToT) Prompting

ReAct Prompting

System Prompting

Role Prompting

Contextual Prompting

What is Zero-Shot Prompting ? 

Zero-shot prompting provides only a task description without examples, relying on the model's training patterns. Simply describe the task clearly, provide input data, and optionally specify output format. Works well for simple classification, text generation, and Q&A, but may produce inconsistent results for complex tasks.

What is One-Shot & Few-Shot Prompting? 

One-shot provides a single example to guide model behavior, while few-shot includes multiple examples (3-5) to demonstrate desired patterns. Examples show output structure, style, and tone, increasing accuracy and consistency. Use few-shot for complex formatting, specialized tasks, and when zero-shot results are inconsisten

What is Step-Back Prompting ? 

Step-back prompting improves LLM performance by first asking a general question related to the specific task, then using that answer to inform the final response. This technique activates relevant background knowledge before attempting the specific problem. For example, before writing a video game level storyline, first ask "What are key settings for engaging first-person shooter levels?" then use those insights to create the specific storyline. This approach reduces biases and improves accuracy by grounding responses in broader principle

What is : Chain of Thought (CoT) Prompting

Chain of Thought prompting improves LLM reasoning by generating intermediate reasoning steps before providing the final answer. Instead of jumping to conclusions, the model "thinks through" problems step by step. Simply adding "Let's think step by step" to prompts often dramatically improves accuracy on complex reasoning tasks and mathematical problem

What is : Self-Consistency Prompting

Self-consistency prompting generates multiple reasoning paths for the same problem using higher temperature settings, then selects the most commonly occurring answer through majority voting. This technique combines sampling and voting to improve accuracy and provides pseudo-probability of answer correctness. While more expensive due to multiple API calls, it significantly enhances reliability for complex reasoning tasks by reducing the impact of single incorrect reasoning chains and leveraging diverse problem-solving approaches.

What is : Tree of Thoughts (ToT) Prompting

Tree of Thoughts (ToT) generalizes Chain of Thought by allowing LLMs to explore multiple reasoning paths simultaneously rather than following a single linear chain. This approach maintains a tree structure where each thought represents a coherent step toward solving a problem, enabling the model to branch out and explore different reasoning directions. ToT is particularly effective for complex tasks requiring exploration and is well-suited for problems that benefit from considering multiple solution approaches before converging on the best answer

What is ReAct Prompting ?

ReAct (Reason and Act) prompting enables LLMs to solve complex tasks by combining reasoning with external tool interactions. It follows a thought-action-observation loop: analyze the problem, perform actions using external APIs, review results, and iterate until solved. Useful for research, multi-step problems, and tasks requiring current data.

What is System Prompting ? 

System prompting sets the overall context, purpose, and operational guidelines for LLMs. It defines the model's role, behavioral constraints, output format requirements, and safety guardrails. System prompts provide foundational parameters that influence all subsequent interactions, ensuring consistent, controlled, and structured AI responses throughout the session

What is Role Prompting ? 

Role prompting assigns a specific character, identity, or professional role to the LLM to generate responses consistent with that role's expertise, personality, and communication style. By establishing roles like "teacher," "travel guide," or "software engineer," you provide the model with appropriate domain knowledge, perspective, and tone for more targeted, natural interactions

What is Contextual Prompting ? 

Contextual prompting provides specific background information or situational details relevant to the current task, helping LLMs understand nuances and tailor responses accordingly. Unlike system or role prompts, contextual prompts supply immediate, task-specific information that's dynamic and changes based on the situation. For example: "Context: You are writing for a blog about retro 80's arcade video games. Suggest 3 topics to write articles about." This technique ensures responses are relevant, accurate, and appropriately framed for the specific context provided

What is Automatic Prompt Engineering ?

Automatic Prompt Engineering (APE) uses LLMs to generate and optimize prompts automatically, reducing human effort while enhancing model performance. The process involves prompting a model to create multiple prompt variants, evaluating them using metrics like BLEU or ROUGE, then selecting the highest-scoring candidate. For example, generating 10 variants of customer order phrases for chatbot training, then testing and refining the best performers. This iterative approach helps discover effective prompts that humans might not consider, automating the optimization process.

What is AI Red Teaming ? 

AI red teaming involves deliberately testing AI systems to find vulnerabilities, biases, or harmful behaviors through adversarial prompting. Teams attempt to make models produce undesired outputs, bypass safety measures, or exhibit problematic behaviors. This process helps identify weaknesses and improve AI safety and robustness before deployment

What are Prompting Best Practices ? 

— Provide few-shot examples for structure or output style you need
— Keep your prompts short and concise
— Ask for structured output if it helps e.g. JSON, XML, Markdown, CSV etc
— Use variables / placeholders in your prompts for easier configuration
— Prioritize giving clearer instructions over adding constraints
— Control the maximum output length
— Experiment with input formats and writing styles
— Tune sampling (temperature, top-k, top-p) for determinism vs creativity
— Guard against prompt injection; sanitize user text
— Automate evaluation; integrate unit tests for outputs
— Document and track prompt versions
— Optimize for latency & cost in production pipelines
— Document decisions, failures, and learnings for future devs
— Delimit different sections with triple backticks or XML tags

How to improve reliability ? 

Prompt Debiasing
Prompt Ensembling
LLM Self Evaiuation
Calibrating LLMs

What is Prompt debiasing ? 

Prompt debiasing involves techniques to reduce unwanted biases in LLM outputs by carefully crafting prompts. This includes using neutral language, diverse examples, and explicit instructions to avoid stereotypes or unfair representations. Effective debiasing helps ensure AI outputs are more fair, inclusive, and representative across different groups and perspectives

What is Prompt Ensembling ? 

Prompt ensembling combines multiple different prompts or prompt variations to improve output quality and consistency. This technique involves running the same query with different prompt formulations and aggregating results through voting, averaging, or selection. Ensembling reduces variance and increases reliability by leveraging diverse prompt perspectives

What is LLM Self Evaluation ? 

LLM self-evaluation involves prompting models to assess their own outputs for quality, accuracy, or adherence to criteria. This technique can identify errors, rate confidence levels, or check if responses meet specific requirements. Self-evaluation helps improve output quality through iterative refinement and provides valuable feedback for prompt optimization.

What is Calibrating LLMs ? 

Calibrating LLMs involves adjusting models so their confidence scores accurately reflect their actual accuracy. Well-calibrated models express appropriate uncertainty - being confident when correct and uncertain when likely wrong. This helps users better trust and interpret model outputs, especially in critical applications where uncertainty awareness is crucial

What are the 4 Most AI solves four types of problems ? 

iamge

What happened in the decade that we hear about AI so much?

Increase in computational power
Decrease in cost of computation
Increase in internet speed
Decrease in cost of internet
Newer business models e.g., platforms

What are the Three types of models in ML ? 

Supervised: use labelled data to learn
Unsupervised: use unlabelled data to learn
Reinforcement learning : use reward to train the model

What is  AUGMENTED INTELLIGENCE ? 

AUGMENTED INTELLIGENCE = Human + AI

How  AI can be augmented in a human/human team ?

image

In many tasks, 

augmentation will lead the way, as it depends on the…

1. Accuracy of the AI
2. Accuracy of the human
3. Data availability
4. Cost
5. Risk
6. Ethical considerations
7. Etc.

What is Task splitting ? 

Split T into T1, T2 and assign one of them to A

What is Sequencing ? 

Create a new task for AI, human uses the AI prediction + data to predict on T

What is Error cancellation (ensemble)? 

image

And a phenomenon called ‘algorithm aversion’ (under reliance) – why?

• Even if AI is accurate – Trust own judgement
• When AI makes an error – Penalize algorithms more than humans

Evolutionary elements that help us survive…also play a part how we collaborate with AI

Use less energy to make decisions
Little bit of stress followed by reward is addictive
Transfer learning
Social conformance & power

AI feedback: Driving, 
Technology enabled feedback: Driving

Do you think people will improve driving?

NO

• Feedback may have negative feedback for driving
• Only people seeing very low scores improve their performance
• So how to design better feedback?

Why people are averse in following AI advice?

Trust
Blackbox nature
Accuracy
Threat
Lack of control
Bias