Top Banner Ad
2026-27 Model Paper · Predicted Practice SetSyllabus-aligned practice paper with marking scheme
AAI101 · 2026-27 Model Paper (Set 1)22 Questions

Introduction to AI and Prompt Engineering — 2026-27 Model Paper (Set 1)

Section A

2 Marks Each · 4 questions
Q62MUnit 4 — AI in Civil Engineering
Survival Mode

Give one application of AI in civil engineering and one in mechanical engineering.

Answer: Civil engineering: AI-based structural health monitoring of bridges and buildings using sensor or image data to detect cracks and stress. (1 mark) Mechanical engineering: AI-based predictive maintenance of machines from vibration and temperature sensor data. (1 mark) Result: AI detects structural damage in civil work and predicts machine failure in mechanical work.

Key Points

  • Civil: structural health monitoring of bridges/buildings (1 mark)
  • Mechanical: predictive maintenance using sensor data (1 mark)
Q72MUnit 5 — Zero-shot prompting
Survival Mode

What is zero-shot prompting?

Zero-shot prompting is a technique where a direct question is given to an AI model without providing any examples. The model relies solely on its pre-trained knowledge to generate a response. Example: 'Explain the water cycle in 3 sentences.' No input-output pairs are supplied in the prompt.

Key Points

  • No examples or demonstrations are provided in the prompt
  • Model uses only its pre-trained internal knowledge
  • Simplest prompting technique; fastest to write
  • Works well for common knowledge tasks; may fail on niche domains
Q1(a)7MUnit 1 — AI vs Machine Learning vs Deep Learning
Survival ModePredicted

(a) Explain AI, Machine Learning, and Deep Learning with differences. How do machines learn using data, patterns, and predictions?

Concept / Given Data: This question has two parts: (a) define and differentiate AI, Machine Learning (ML), and Deep Learning (DL); (b) explain the conceptual pipeline by which machines learn from data, identify patterns, and make predictions — no mathematics required.

Key Relationship: $\text{Deep Learning} \subset \text{Machine Learning} \subset \text{Artificial Intelligence}$

AI is the goal (machines performing intelligent tasks); ML is a method to achieve it (learning from data); DL is a subset of ML using multi-layer neural networks.

Step-by-Step Explanation:

Part (a) — Definitions and Differences:

  1. Artificial Intelligence (AI): The broadest field. It encompasses any technique that enables a machine to perform a task requiring human intelligence — perception, reasoning, planning, language understanding. AI includes rule-based systems, search algorithms, and learning-based approaches.
  2. Machine Learning (ML): A sub-field of AI where the system learns patterns from data rather than following hand-coded rules. Given a dataset, the algorithm adjusts internal parameters to minimise error on a task. Examples: linear regression, decision trees, support vector machines, random forests.
  3. Deep Learning (DL): A sub-field of ML that uses artificial neural networks with many hidden layers ("deep" architectures). DL excels at hierarchical feature extraction — lower layers detect edges, higher layers detect objects. Examples: CNNs (images), RNNs/Transformers (text), GANs (generation).
Aspect AI ML DL
Scope All intelligent behaviour Learning from data Multi-layer neural nets
Data need May not need data (rule-based) Needs training data Needs large training data
Feature engineering Hand-coded rules Often manual features Automatic feature learning
Example Expert system (MYCIN) Random Forest classifier ResNet image classifier

Part (b) — How Machines Learn: Data → Patterns → Predictions:

  1. Data Collection: Gather raw examples relevant to the task. For a spam filter, this means thousands of emails labelled "spam" or "not spam." For a crop-yield predictor (AG branch), this means historical yield records with weather and soil features.
  2. Data Pre-processing: Clean missing values, remove duplicates, normalise scales, and split into training and test sets. Quality of data directly determines quality of the learned model.
  3. Pattern Discovery (Training): The algorithm iteratively adjusts its internal parameters (weights) to find statistical regularities in the data. In a neural network, backpropagation computes how much each weight should change to reduce prediction error. The machine is not "understanding" — it is fitting a function f:X→Yf: X \rightarrow Y that maps inputs to outputs.
  4. Prediction (Inference): Once trained, the model receives new, unseen input and outputs a prediction. A trained spam filter receives a new email and outputs a probability P(spam∣email)P(\text{spam} \mid \text{email}). A trained crop model receives this season's weather data and outputs a predicted yield in tonnes per hectare.
  5. Evaluation & Iteration: Compare predictions against known outcomes on the test set. If accuracy is insufficient, collect more data, tune hyper-parameters, or choose a different model architecture.
DataPatternDiscoveryPredictionon new dataTrain → Evaluate → Iterate

Result: AI is the umbrella goal; ML is the data-driven route; DL is the deep-network specialisation. Machines learn by fitting a mapping from data to outputs, discovering statistical patterns during training, and applying that mapping to make predictions on unseen inputs.

Tip from Examiner: Examiners award 2 marks for the Venn/subset relationship, 2 marks for the comparison table (at least 3 rows), and 3 marks for the data→pattern→prediction pipeline with a concrete example. A frequent error is writing "DL is a type of AI" without stating it is a *subset of ML*. Always name one real-world example per level (e.g., rule-based chess = AI, random forest = ML, ResNet = DL) to lock in full marks.

Key Points

  • Subset relationship: DL ⊂ ML ⊂ AI — always state this explicitly in one line
  • AI = goal (intelligent tasks), ML = method (learn from data), DL = subset (multi-layer neural networks)
  • Machines learn by fitting a function f: X→Y from training data, discovering statistical patterns, then applying it to unseen inputs for prediction
  • The pipeline is: Collect → Pre-process → Train (pattern discovery) → Predict (inference) → Evaluate → Iterate
  • Deep learning automatically learns hierarchical features (edges → shapes → objects), removing the need for manual feature engineering
  • One concrete example per level secures full marks: rule-based system = AI, random forest = ML, ResNet/Transformer = DL
Q1(b)7MUnit 1 — Data
Core Concept

(b) Describe common AI systems used in daily life such as Google Maps, Spotify, Netflix, Google Photos, and voice assistants. Explain what each system learns from user data.

Concept / Given Data:

Artificial Intelligence systems embedded in everyday applications learn from user-generated data to produce personalised outputs. Each system follows the same underlying pipeline: collect data → identify patterns → make predictions. The five systems asked are Google Maps, Spotify, Netflix, Google Photos, and voice assistants.

Key Principle: Each system learns a mapping $f: \text{User Data} \rightarrow \text{Prediction/Recommendation}$ by minimising error over historical interactions.

Step-by-Step Explanation:

  1. Google Maps — Collects real-time GPS coordinates, traffic density, and historical travel times from millions of users. It learns the pattern of how congestion evolves by hour, day, and season, then predicts the fastest route for the next trip. The output is a dynamically updated route with an estimated arrival time.

  2. Spotify — Records every play, skip, like, and playlist addition. It learns collaborative-filtering patterns: users who listened to similar songs also enjoyed certain tracks. The system predicts which songs a user will enjoy next and builds the "Discover Weekly" playlist.

  3. Netflix — Logs watch time, pause points, ratings, and genre preferences. It learns which content a user is likely to finish and rewatch, then ranks the catalogue to surface the most probable next watch. The output is a personalised homepage row.

  4. Google Photos — Extracts visual features (faces, objects, locations, timestamps) from every uploaded image. It learns to cluster similar faces into person groups and to tag scenes automatically. The output is organised albums and searchable keywords.

  5. Voice Assistants (Siri, Alexa, Google Assistant) — Capture spoken audio, convert it to text via speech recognition, then parse intent. They learn from past queries which commands a user frequently issues and refine the language model to reduce misinterpretation. The output is a spoken or on-screen action.

Visual Summary:

System Data Collected Pattern Learned Output
Google Maps GPS, traffic, travel time Congestion by time/season Fastest route + ETA
Spotify Plays, skips, likes Collaborative taste clusters Song recommendations
Netflix Watch time, ratings, pauses Completion & preference profile Ranked homepage
Google Photos Image features, EXIF Face/scene clusters Auto-albums, tags
Voice Assistant Audio, query history Intent + user habits Spoken/action response

Result: All five systems share the same architecture — they ingest user data, discover statistical patterns, and emit a prediction that improves with more interactions. The more a user engages, the more accurate the model becomes, which is the defining characteristic of a learning system.

Tip from Examiner: In the 7-mark "AI today" question, examiners award 1 mark per system for naming the data collected, 1 mark for stating the pattern learned, and 1 mark for the output. Do NOT just list app names — always write the data → pattern → output triplet for each. A common mistake is describing the app's function (e.g., "it shows maps") instead of what it *learns*. Use the phrase "learns from" explicitly for each row.

Key Points

  • Each daily-life AI system follows: collect data → learn pattern → predict output
  • Google Maps learns congestion patterns from GPS and traffic data to predict fastest routes
  • Spotify and Netflix use collaborative filtering on play/watch history to recommend content
  • Google Photos learns face and scene clusters from image features for auto-organisation
  • Voice assistants learn intent from query history to reduce speech misinterpretation
  • All five improve accuracy with more user interactions — the hallmark of a learning system

Section B

7 Marks Each · 12 questions
Q12MUnit 1 — Definition and scope of AI
Survival Mode

Define Artificial Intelligence and mention one everyday example.

Artificial Intelligence (AI) is the field of computer science that designs systems capable of performing tasks that normally require human intelligence, such as reasoning, learning, perception, and decision‑making. Everyday example: voice assistants like Amazon Alexa interpret spoken commands and respond with appropriate actions.

Key Points

  • AI enables machines to mimic human cognitive functions
  • Core tasks include reasoning, learning, perception, decision‑making
  • Voice assistants illustrate AI by processing natural language
Q22MUnit 1 — Unsupervised
Core Concept

Differentiate between supervised and unsupervised learning in one point each.

Answer: Supervised learning uses labeled input-output data to learn a mapping, e.g., spam classification. (1 mark) Unsupervised learning uses unlabeled data to discover hidden patterns or groups, e.g., customer clustering. (1 mark) Result: Supervised learning needs labels; unsupervised learning finds structure without labels.

Key Points

  • Supervised: labeled input-output pairs, e.g., spam classification (1 mark)
  • Unsupervised: unlabeled data, discovers groups, e.g., customer clustering (1 mark)
Q32MUnit 2 — Classification Techniques- KNearest Neighbors (KNN)
Survival Mode

What is K-Nearest Neighbors (KNN)?

K‑Nearest Neighbors (KNN) is a lazy, instance‑based learning algorithm that classifies a query point by majority vote of its kk closest training samples in feature space, using a distance metric such as Euclidean d(mathbfx,mathbfy)=sqrtsumi(xi−yi)2d(mathbf{x},mathbf{y})=sqrt{sum_i(x_i-y_i)^2}.

Key Points

  • Instance‑based learning
  • Majority vote of kk nearest points
  • Euclidean distance
Q42MUnit 2 — Classification metrics-accuracy
Core Concept

Write the formula for accuracy in classification.

Answer: Accuracy = (TP + TN) / (TP + TN + FP + FN), where TP = true positives, TN = true negatives, FP = false positives and FN = false negatives. It is the fraction of all predictions that are correct. (Formula 2 marks) Result: Accuracy measures overall correctness of a classifier as correct predictions divided by total predictions.

Key Points

  • Accuracy = (TP + TN)/(TP + TN + FP + FN) (2 marks)
  • TP, TN, FP, FN from the confusion matrix
Q52MUnit 3 — Large Language Models (LLMs)
Survival Mode

What is a Large Language Model (LLM)?

A Large Language Model (LLM) is a neural network trained on vast text corpora to predict the next token in a sequence. It learns statistical patterns of language, enabling it to generate coherent text, answer questions, and perform language tasks. The core operation is

P(ti+1midt1,dots,ti)P(t_{i+1}mid t_1,dots,t_i)

where tjt_j denotes token jj.

Key Points

  • Neural network trained on large text
  • Predicts next token
  • Generates coherent language
  • Core formula P(ti+1midt1,dots,ti)P(t_{i+1}mid t_1,dots,t_i)
Q17MUnit 1 — General AI
Survival Mode

Explain the evolution of AI from early ideas to modern systems. Also distinguish among Narrow AI, General AI, and Super AI.

Concept / Given Data: Artificial Intelligence (AI) is the field of computer science that builds systems capable of performing tasks that would normally require human intelligence — perception, reasoning, learning, and decision-making. The question asks for (i) a chronological evolution from early ideas to modern systems and (ii) a clear distinction among the three types of AI.

Key Principle: AI capability grows along a spectrum — $\text{Narrow AI} \subset \text{General AI} \subset \text{Super AI}$ — where each level adds breadth and autonomy beyond the previous one.

Step-by-Step Evolution:

  1. 1950 – Turing Test (Alan Turing): Turing proposed the Imitation Game — if a machine can converse indistinguishably from a human, it is "intelligent." This became the philosophical benchmark for AI.
  2. 1956 – Dartmouth Conference: The term Artificial Intelligence was coined by John McCarthy, Marvin Minsky, and others. Early symbolic AI (expert systems) used hand-coded rules.
  3. 1980s – Expert Systems & Knowledge Bases: MYCIN (medical diagnosis) and XCON (hardware configuration) showed domain-specific rule engines could outperform humans in narrow tasks.
  4. 1990s – Machine Learning Emerges: Statistical learning (decision trees, neural networks) replaced pure rule-based approaches. Backpropagation made multi-layer networks trainable.
  5. 2012 – Deep Learning Revolution: AlexNet won ImageNet by a large margin, proving that deep neural networks trained on big data could surpass human-level perception.
  6. 2017–2022 – Transformers & LLMs: The Transformer architecture ("Attention Is All You Need") enabled large language models. GPT-3 (2020) and ChatGPT (2022) demonstrated general-purpose language understanding and generation.
  7. 2023–Present – Multimodal & Agentic AI: Models now process text, image, audio, and video jointly; AI agents can plan and execute multi-step tasks.

Distinguishing the Three Types:

Feature Narrow AI (ANI) General AI (AGI) Super AI (ASI)
Scope Single or few tasks All human cognitive tasks Exceeds all human intelligence
Examples Google Maps, Spotify, spam filter Does not yet exist Hypothetical future
Learning Trained on specific data Would learn any task from few examples Would self-improve beyond human capacity
Status Exists today Theoretical Conceptual / speculative
  • Narrow AI (ANI): Designed for one specific task. It does not transfer knowledge across domains. Every AI product a student uses daily (voice assistant, recommendation engine, face unlock) is Narrow AI.
  • General AI (AGI): A hypothetical system that could understand, learn, and apply intelligence across any intellectual task a human can perform, at human level or above. No current system achieves this.
  • Super AI (ASI): A further hypothetical stage where the system surpasses human intelligence in every domain — science, creativity, social intuition — and can improve itself recursively. This remains a concept discussed in AI safety literature.
Narrow AI(Exists)General AI(Theoretical)Super AI(Concept)Increasing capability and breadth →

Result: AI has evolved from a philosophical test (1950) through symbolic expert systems, statistical ML, deep learning, and now large multimodal models. Narrow AI is the only type that exists; General and Super AI remain aspirational concepts that define the long-term research goal.

Tip from Examiner: In the 7-mark answer, spend roughly 3 marks on the timeline (name at least 4 milestones with years) and 4 marks on the three-type table. A common mistake is describing only Narrow AI and forgetting to explicitly state that AGI and ASI do *not* yet exist. Always add one concrete example per type to secure full marks.

Key Points

  • Timeline: Turing Test (1950) → Dartmouth (1956) → Expert Systems (1980s) → Deep Learning (2012) → Transformers/LLMs (2017–2022) → Multimodal AI (2023+)
  • Narrow AI = single-task, exists today (Maps, Spotify); General AI = all human tasks, theoretical; Super AI = exceeds all human intelligence, conceptual
  • The three types form a capability spectrum: ANI ⊂ AGI ⊂ ASI in both scope and autonomy
  • Dartmouth Conference (1956) is where the term 'Artificial Intelligence' was first coined by McCarthy and colleagues
  • AlexNet (2012) and the Transformer architecture (2017) are the two most-cited turning points in modern AI history
Q27MUnit 2 — weights (simple diagram)
Survival Mode

Describe the concept of a neural network. Explain neurons, layers, and weights with a simple diagram, and state what makes deep learning "deep".

Concept Overview A neural network is a computational model inspired by the biological brain. It consists of interconnected neurons that receive inputs, apply a weighted sum, add a bias, and pass the result through an activation function to produce an output. Multiple neurons are arranged in layers – an input layer, one or more hidden layers, and an output layer. The term deep learning refers to networks that contain many hidden layers, allowing them to learn hierarchical feature representations (edges → textures → objects) automatically.

Key Formula / Principle: y=σ(∑i=1nwixi+b)y = \sigma\Big(\sum_{i=1}^{n} w_i x_i + b\Big)

Step‑by‑Step Explanation

  1. Neuron structure – each neuron jj receives a vector of inputs x={x1,x2,…,xn}\mathbf{x}=\{x_1, x_2, …, x_n\}.
  2. Weight multiplication – each input is multiplied by a trainable weight wijw_{ij} (the connection strength from input ii to neuron jj).
  3. Bias addition – a scalar bias bjb_j is added to the weighted sum to shift the activation.
  4. Activation – the summed value zj=∑iwijxi+bjz_j = \sum_i w_{ij}x_i + b_j is transformed by an activation function σ(⋅)\sigma(\cdot) (e.g., ReLU, sigmoid) to produce the neuron output yjy_j.
  5. Layer stacking – outputs of one layer become inputs to the next layer, enabling the network to compose simple features into more complex ones.
  6. Training – during supervised learning, the network adjusts all weights wijw_{ij} and biases bjb_j using gradient‑descent‑based algorithms to minimise a loss function (e.g., mean‑squared error).
  7. Depth – when the number of hidden layers exceeds a modest count (typically >3), the architecture is called deep. Depth provides the capacity to model highly non‑linear mappings and to automatically extract abstract features from raw data.
w₁ w₂ w₃ σ(z) Inputs Output

Result: The network transforms raw inputs into a final prediction by propagating weighted sums through successive layers; depth is achieved when many hidden layers are stacked, each learning increasingly abstract representations.

Tip from Examiner: Allocate marks – 2 marks for defining a neuron, 2 marks for layers, 2 marks for weights & diagram, 1 mark for stating why depth matters. Avoid writing the full training algorithm; focus on structural description.

Key Points

  • Neuron computes weighted sum plus bias and passes through activation
  • Layers stack neuron outputs to form hierarchical feature extraction
  • Depth = multiple hidden layers enabling abstract representation
Q37MUnit 3 — Large Language Models (LLMs)
Survival Mode

Explain Generative AI and Large Language Models. Discuss tokens, context window, temperature, and any two limitations of LLMs.

Concept / Given Data

Generative AI refers to systems that create new content—text, images, code, audio or video—rather than merely classifying or predicting existing data. Large Language Models (LLMs) are a class of generative AI that learn statistical patterns from massive text corpora and generate coherent language. Key parameters that shape an LLM’s output are tokens, the context window, and the temperature. Two common limitations are hallucination (confident but false statements) and knowledge cutoff (no information beyond the training end date).

Key Formula / Principle: Navailable=Wtotal−Nprompt−Nretrieved−NsafetyN_{\text{available}}=W_{\text{total}}-N_{\text{prompt}}-N_{\text{retrieved}}-N_{\text{safety}}

Step‑by‑Step Solution

  1. Tokens – A token is a sub‑word unit; on average 1 token ≈ 4 English characters. The model converts the prompt into token IDs, maps them to embeddings, and predicts the next token.
  2. Context Window – The maximum number of tokens the model can process simultaneously. For GPT‑4‑o, Wtotal=8192W_{\text{total}}=8192. If the prompt uses Nprompt=1800N_{\text{prompt}}=1800 tokens and retrieved text Nretrieved=1500N_{\text{retrieved}}=1500, and we reserve Nsafety=100N_{\text{safety}}=100 for safety filters, then
Navailable=8192−1800−1500−100=4592N_{\text{available}}=8192-1800-1500-100=4592

tokens remain for the generated answer. 3. Temperature – Controls randomness: T=0T=0 yields deterministic, greedy decoding; T>1T>1 increases diversity. A typical setting is T=0.7T=0.7 for balanced creativity. 4. Hallucination – The model may produce plausible but factually incorrect statements because it optimises likelihood, not truth. 5. Knowledge Cutoff – Training data ends at a fixed date (e.g., 2023‑09); events after that are unknown to the model.

Result: An LLM can generate up to 4592 tokens of content after accounting for prompt, retrieved text, and safety margin, with temperature tuning to balance creativity and reliability. However, users must guard against hallucinations and be aware of the knowledge cutoff.

Tip from Examiner: Allocate 1 mark for defining tokens, 1 mark for the context‑window formula, 1 mark for temperature, and 2 marks for each limitation. Avoid mixing up tokens with characters; remember the 4‑character rule.

Key Points

  • Generative AI creates new content
  • Tokens ≈ 4 characters
  • Context window = total – prompt – retrieved – safety
  • Temperature controls randomness
  • Hallucination = confident false output
  • Knowledge cutoff = end of training data
Q47MUnit 4 — Ethical concerns
Survival Mode

Discuss AI applications in at least three engineering domains. Also explain any two ethical concerns related to AI deployment.

Concept / Given Data:

AI is now embedded across every engineering branch. This answer covers three domains — Civil, Electrical, and Biotechnology/Healthcare — using the standard chain: problem → data → AI method → decision → benefit → caution. Two ethical concerns (bias and data privacy) are then explained with mitigations.

Key Principle: Every AI application follows the pipeline Raw Data→PreprocessFeatures→Modely^→Threshold τDecision\text{Raw Data} \xrightarrow{\text{Preprocess}} \text{Features} \xrightarrow{\text{Model}} \hat{y} \xrightarrow{\text{Threshold } \tau} \text{Decision}

where y^\hat{y} is the model output and τ\tau is the action threshold.

Step 1 — Civil Engineering (Structural Health Monitoring):

  • Problem: Bridges and buildings degrade silently; sudden failure is catastrophic.
  • Data: Accelerometer, strain-gauge, and crack-width sensor readings sampled at fs=100 Hzf_s = 100\text{ Hz} over months.
  • AI method: A 1-D CNN or LSTM learns the healthy vibration signature; anomaly detection flags deviation beyond a learned threshold τ\tau.
  • Decision: Alert maintenance when modal-energy change ΔE>τ\Delta E > \tau.
  • Benefit: Reduces inspection cost by up to 40% and prevents collapse.
  • Caution: Sensor drift causes false alarms; periodic recalibration is essential.

Step 2 — Electrical Engineering (Smart Grids):

  • Problem: Load demand fluctuates unpredictably; mismatch causes blackouts or wasted generation.
  • Data: Historical load profiles, weather forecasts, and real-time SCADA line currents.
  • AI method: A time-series model (Transformer or GRU) predicts next-hour demand D^t+1\hat{D}_{t+1}; a separate classifier detects abnormal line behaviour as a fault.
  • Decision: Dispatch optimiser schedules generation and battery storage to match D^t+1\hat{D}_{t+1}; fault alarm triggers protective relays.
  • Benefit: Cuts peak-load cost and improves reliability (SAIDI reduction).
  • Caution: Adversarial manipulation of sensor data can fool the model; input validation is needed.

Step 3 — Biotechnology / Healthcare (Medical Imaging):

  • Problem: Radiologists face high workload; subtle lesions (early-stage tumours) can be missed.
  • Data: DICOM CT/MRI scans, preprocessed (noise removal, normalisation, cropping to ROI).
  • AI method: A 3-D CNN (U-Net for segmentation + ResNet for classification) outputs probability p=P(lesion∣image)p = P(\text{lesion} \mid \text{image}).
  • Decision: If p>0.85p > 0.85, flag for urgent radiologist review.
  • Benefit: Reduces time-to-diagnosis from days to minutes; improves cross-shift consistency.
  • Caution: Model must be clinically validated; a false negative can delay treatment.

Ethical Concern 1 — Bias in AI:

If training data over-represents one demographic (e.g., a skin-lesion model trained mostly on light-skinned patients), accuracy drops for under-represented groups, creating unequal healthcare outcomes. Mitigation: audit test sets across demographics, use balanced sampling, and publish per-group performance metrics before deployment.

Ethical Concern 2 — Data Privacy:

Medical and industrial sensor data contain personally identifiable information (patient names, location, biometric traces). Storing or sharing such data without consent violates regulations like GDPR or India's DPDP Act. Mitigation: apply differential privacy, use federated learning (model trains locally; only gradients are shared), and enforce strict role-based access controls.

Domain Data Source AI Model Output Key Risk
Civil Vibration / strain sensors 1-D CNN / LSTM Anomaly score ΔE\Delta E Sensor drift
Electrical SCADA + weather Transformer / GRU D^t+1\hat{D}_{t+1}, fault flag Adversarial input
Healthcare DICOM CT/MRI 3-D CNN (U-Net + ResNet) p(lesion)p(\text{lesion}) False negative

Result: Three distinct engineering domains demonstrate that AI moves from raw sensor/scan data to an actionable decision through a learnable model. The two ethical concerns — bias and privacy — are not optional add-ons; they must be addressed before deployment to ensure fair, lawful, and safe operation.

Tip from Examiner: For this 7-mark question, examiners award 2 marks per domain (problem + method + benefit) and 1.5 marks per ethical concern (definition + mitigation). A common mistake is listing domains without naming the specific AI model — always write the model type (CNN, LSTM, Transformer). Another trap: confusing *bias* (unequal accuracy across groups) with *variance* (overfitting). Keep the two ethical concerns clearly separated with bold headings so the marker can tick them off quickly.

Key Points

  • Use the chain problem → data → AI method → decision → benefit → caution for each domain
  • Civil: 1-D CNN/LSTM on vibration data detects structural anomaly when ΔE > τ
  • Electrical: Transformer/GRU forecasts demand D̂(t+1) and flags faults from SCADA data
  • Healthcare: 3-D CNN (U-Net + ResNet) outputs lesion probability p; threshold 0.85 triggers review
  • Bias: unequal accuracy across demographics; mitigate with balanced sampling and per-group audits
  • Data privacy: PII in sensor/medical data; mitigate with differential privacy and federated learning
Q57MUnit 5 — Principles of good prompting
Survival Mode

Explain the principles of good prompting. Describe zero-shot, few-shot, chain-of-thought, and role prompting with one example each.

A prompt is the instruction given to an AI model that determines the quality, format, and relevance of its output. The same model produces vastly different results depending on how the prompt is written.

Principles of Good Prompting:

  1. Clarity — Use unambiguous language; avoid vague terms like "something" or "stuff."
  2. Context — Provide background so the model knows the domain, audience, and purpose.
  3. Specificity — State exact requirements (length, tone, structure) rather than leaving them open.
  4. Role Assignment — Tell the model what persona to adopt (e.g., "Act as a civil engineer").
  5. Format Instruction — Specify the output format (bullet points, table, paragraph, JSON).
Key Formula / Principle: Prompt=Role+Task+Context+Format+Constraint\text{Prompt} = \text{Role} + \text{Task} + \text{Context} + \text{Format} + \text{Constraint}

Prompting Techniques with Examples:

Step 1 — Zero-shot prompting: Ask a direct question with no examples. The model relies entirely on its pre-trained knowledge.

  • Example: "Explain the difference between tensile and compressive strength of concrete."

Step 2 — Few-shot prompting: Provide 2–3 worked input→output pairs so the model mimics the pattern.

  • Example: "Classify the following crack types. Input: 'hairline crack along beam' → Output: 'Type I – superficial'. Input: 'diagonal shear crack at support' → Output: 'Type III – structural'. Now classify: 'longitudinal crack along deck' →"

Step 3 — Chain-of-thought prompting: Instruct the model to reason step by step before giving the final answer. This reduces logical errors on multi-step problems.

  • Example: "A simply supported beam of span L=6 mL = 6\,\text{m} carries a UDL of w=20 kN/mw = 20\,\text{kN/m}. Think step by step: first find reactions, then maximum bending moment, then check against allowable stress. Show each step."

Step 4 — Role prompting: Assign a professional identity to focus the model's vocabulary, depth, and perspective.

  • Example: "Act as a senior structural engineer with 20 years of bridge inspection experience. Review the following crack pattern and recommend repair priority."

Result: Combining all five principles with the appropriate technique yields outputs that are domain-accurate, well-structured, and directly usable — the hallmark of professional prompt engineering.

Tip from Examiner: In 7-mark answers, write one concrete example per technique (not just the definition). Examiners award 1 mark per technique for the example alone. A common mistake is describing few-shot as "giving hints" — it specifically means providing 2–3 complete input→output pairs. Also note that chain-of-thought is NOT the same as asking for a "detailed answer"; it explicitly requires showing intermediate reasoning steps.

Key Points

  • Five principles: clarity, context, specificity, role assignment, format instruction
  • Zero-shot = direct question, no examples; relies on pre-trained knowledge
  • Few-shot = 2-3 worked input-output pairs to demonstrate the pattern
  • Chain-of-thought = 'think step by step' to reduce multi-step logical errors
  • Role prompting = assign a professional persona to calibrate vocabulary and depth
  • Prompt formula: Role + Task + Context + Format + Constraint
Q2(a)7MUnit 2 — Naïve Bayes
Survival ModePredicted

(a) Explain classification using KNN and Naive Bayes. Compare them on working principle, data requirement, and a suitable use case.

Classification Using K‑Nearest Neighbours (KNN) and Naïve Bayes

Both algorithms assign a class label to an unseen instance, but they differ fundamentally in how they model the data.

KNN Decision Rule: y^=mode⁡{yi  ∣  xi∈Nk(x)}\hat{y}=\operatorname{mode}\{y_i\;|\;x_i\in\mathcal{N}_k(x)\}
Naïve Bayes Posterior: P(C∣x)=P(C)∏j=1dP(xj∣C)∑c′P(c′)∏j=1dP(xj∣c′)P(C\mid x)=\frac{P(C)\prod_{j=1}^{d}P(x_j\mid C)}{\sum_{c'}P(c')\prod_{j=1}^{d}P(x_j\mid c')}

Step‑by‑Step Comparison

  1. Working Principle
    • KNN: Instance‑based; stores the entire training set. For a query xx, compute distances (e.g., Euclidean) to all training points, pick the kk nearest, and vote.
    • Naïve Bayes: Probabilistic; learns class priors P(C)P(C) and likelihoods P(xj∣C)P(x_j\mid C) assuming feature independence. Classification uses Bayes theorem to pick the class with highest posterior.
  2. Data Requirement
    • KNN: Needs the full feature vectors at inference time; memory‑intensive for large datasets. No explicit training phase.
    • Naïve Bayes: Requires estimation of probability tables or Gaussian parameters; compact model after training, suitable for high‑dimensional sparse data.
  3. Suitable Use‑Case
    • KNN: Small‑to‑medium sized image or sensor datasets where similarity is meaningful, e.g., handwritten digit recognition with Euclidean distance.
    • Naïve Bayes: Text classification (spam detection) where the independence assumption roughly holds and rapid inference is needed.

Result: KNN is a lazy, distance‑based learner that excels when the notion of "closeness" captures class similarity, while Naïve Bayes is a fast, generative model that leverages probability theory and works well with high‑dimensional categorical data such as words.

Tip from Examiner: Split marks 2 for KNN description, 2 for Naïve Bayes formula, 2 for comparison table, 1 for concise example. Do not over‑detail probability‑density derivations – a single line for Gaussian likelihood is enough.

Key Points

  • KNN classifies by majority vote among k nearest training points
  • Naïve Bayes uses Bayes theorem with conditional independence assumption
  • KNN suits similarity‑based tasks; Naïve Bayes excels in text or high‑dimensional sparse data
Q2(b)7MUnit 2 — Classification metrics-accuracy
Core Concept

(b) Explain classification metrics: accuracy, precision, recall, and F1 score. Why can accuracy be misleading on an imbalanced dataset?

Concept / Given Data: Classification metrics quantify how well a model's predictions match the true labels. Every metric is derived from the confusion matrix, a 2×22 \times 2 table that cross-tabulates predicted class against actual class for a binary problem.

Key Formulas: Accuracy=TP+TNTP+TN+FP+FN\text{Accuracy} = \frac{TP + TN}{TP + TN + FP + FN} Precision=TPTP+FP\text{Precision} = \frac{TP}{TP + FP} Recall=TPTP+FN\text{Recall} = \frac{TP}{TP + FN} F1-score=2×P×RP+RF1\text{-score} = \frac{2 \times P \times R}{P + R}

Step-by-Step Worked Example: Given a confusion matrix with TP=40TP = 40, FP=5FP = 5, FN=10FN = 10, TN=45TN = 45 (total N=100N = 100):

Predicted Positive Predicted Negative
Actual Positive TP=40TP = 40 FN=10FN = 10
Actual Negative FP=5FP = 5 TN=45TN = 45
  1. Accuracy =40+45100=85100=0.85= \frac{40 + 45}{100} = \frac{85}{100} = 0.85
  2. Precision =4040+5=4045≈0.889= \frac{40}{40 + 5} = \frac{40}{45} \approx 0.889
  3. Recall =4040+10=4050=0.80= \frac{40}{40 + 10} = \frac{40}{50} = 0.80
  4. F1-score =2×0.889×0.800.889+0.80=1.42241.689≈0.842= \frac{2 \times 0.889 \times 0.80}{0.889 + 0.80} = \frac{1.4224}{1.689} \approx 0.842

Why Accuracy Can Be Misleading on Imbalanced Datasets: Consider a fraud-detection dataset where 99%99\% of transactions are legitimate and only 1%1\% are fraudulent. A trivial model that predicts "legitimate" for every single transaction achieves an accuracy of 0.990.99 yet catches zero fraud cases. Its recall for the fraud class is 00, and its precision is undefined. In such scenarios, precision (of the positive predictions, how many are truly positive?) and recall (of all actual positives, how many did we catch?) are far more informative. The F1-score provides a single harmonic-mean summary that penalises a large gap between precision and recall, making it the preferred single metric for imbalanced classification tasks.

Result: Accuracy alone hides class-level performance; always report precision, recall, and F1 alongside accuracy, especially when class frequencies differ by more than 10%10\%.

Tip from Examiner: In 2026-27 both model papers asked for accuracy (2 m each). If you extend to precision/recall/F1 in the same answer you earn the full 7 m. Common mistake: writing $F1 = \frac{P+R}{2}$ (arithmetic mean) instead of the harmonic mean. Always show the substitution step with actual numbers — examiners award 1 m for correct arithmetic even if the formula line has a typo.

Key Points

  • Confusion matrix (TP, FP, FN, TN) is the foundation for all four metrics.
  • Accuracy = (TP+TN)/Total; misleading when one class dominates (e.g. 99/1 split).
  • Precision answers: 'Of what I called positive, how many were truly positive?
  • Recall answers: 'Of all true positives, how many did I actually find?
  • F1 is the harmonic mean of P and R; it penalises large gaps between them.
  • Worked values: TP=40, FP=5, FN=10, TN=45 → Acc 0.85, P 0.889, R 0.80, F1 0.842.

Section C

7 Marks Each · 6 questions
Q3(a)7MUnit 3 — Responsible use
Survival ModePredicted

(a) Compare ChatGPT, Gemini, Claude, and Llama as popular LLM families. Discuss multimodal AI and responsible use of generative AI in academics.

Concept / Given Data

Generative AI refers to models that create content such as text, images, code, audio, or video. Large Language Models (LLMs) are the backbone of most generative‑text systems. The four prominent LLM families are:

  1. ChatGPT – OpenAI’s GPT‑4‑based model, fine‑tuned with Reinforcement Learning from Human Feedback (RLHF). It is primarily text‑only but can be coupled with multimodal plugins.
  2. Gemini – Google’s Gemini‑1.5 series, built on the Gemini architecture, trained on a mixture of text, image, and audio data. It offers a unified multimodal API.
  3. Claude – Anthropic’s Claude‑3, designed with a safety‑first approach, using Constitutional AI to reduce hallucinations and bias.
  4. Llama – Meta’s Llama‑2, an open‑source LLM that can be fine‑tuned locally; it supports text and, with extensions, multimodal inputs.

Key Formula / Principle

Token‑to‑Output Mapping: Output=f(Prompt Tokens,Model Parameters)\text{Output} = f(\text{Prompt Tokens}, \text{Model Parameters})

Step‑by‑Step Solution / Derivation

  1. Multimodal AI – A model that ingests multiple modalities (text, image, audio) and produces coherent outputs across them. GPT‑4o, Gemini‑1.5, and Claude‑3.5 are examples. They share a shared embedding space where each modality is projected into a common vector representation.
  2. Responsible Use in Academics –
    • Verification: Always cross‑check AI‑generated content against primary sources.
    • Citation: Treat AI output as a tool; cite the model and version (e.g., ChatGPT‑4, OpenAI, 2024).
    • Disclosure: Declare AI assistance in the methodology or acknowledgements.
    • Plagiarism Prevention: Use plagiarism‑checkers on AI text; avoid submitting verbatim AI output as original work.
    • Bias Mitigation: Be aware that LLMs inherit training‑data biases; critically evaluate gender, cultural, or political slants.
  3. Comparison of Families –
    • Performance: ChatGPT and Gemini lead in conversational fluency; Claude excels in safety; Llama offers best customizability.
    • Accessibility: ChatGPT and Gemini are cloud‑based APIs; Llama can be run locally; Claude offers both.
    • Multimodality: Gemini and Claude provide native multimodal support; ChatGPT requires plugins; Llama needs external adapters.
  4. Practical Example – A student writes a literature review. Using ChatGPT, the student obtains a draft; with Gemini, the student can also embed figures; with Claude, the student benefits from reduced hallucinations; with Llama, the student can fine‑tune on domain‑specific papers.

Result:

The four LLM families differ in safety focus, multimodal capability, and deployment model, but all enable responsible academic use when coupled with verification, citation, and disclosure practices.

Tip from Examiner: Allocate 2 marks for the definition of generative AI, 2 marks for listing the four families, 2 marks for explaining multimodal AI, and 1 mark for outlining responsible‑use guidelines. Avoid jargon; keep each point concise.

Key Points

  • Generative AI creates content across modalities
  • ChatGPT, Gemini, Claude, Llama are leading LLM families
  • Multimodal AI fuses text, image, audio in one model
  • Responsible use: verify, cite, disclose, check bias
  • Claude prioritises safety, Gemini offers native multimodality
  • Llama is open‑source and locally deployable
Q3(b)7MUnit 3 — AI image generation
Core Concept

(b) What is AI image generation? Explain the concept of Stable Diffusion, Midjourney, and DALL-E, and discuss hallucination and knowledge cutoff in LLMs.

Concept / Given Data:

AI image generation is the process where a neural network creates novel visual content (pixels) from a text prompt or a noise signal. Unlike image classification (which labels an existing picture), generation synthesises a new image that has never existed before. The three most prominent tools are Stable Diffusion, Midjourney, and DALL-E.

Key Principle (Diffusion Process): xt=αt x0+1−αt ϵ,ϵ∼N(0,I)x_t = \sqrt{\alpha_t}\, x_0 + \sqrt{1-\alpha_t}\, \epsilon, \quad \epsilon \sim \mathcal{N}(0, I)

where x0x_0 is the clean image, xtx_t is the noisy version at step tt, and αt\alpha_t is the cumulative noise schedule. The model learns to reverse this process: x^t−1=fθ(xt, t, c)\hat{x}_{t-1} = f_\theta(x_t,\, t,\, c) where cc is the text conditioning vector.

Step-by-Step Explanation of Each Tool:

  1. Stable Diffusion (Stability AI, 2022): An open-source latent diffusion model. It operates in a compressed latent space (not raw pixels), making it fast enough to run on consumer GPUs. The pipeline is: text prompt → CLIP text encoder → cross-attention conditioning → denoising U-Net in latent space → VAE decoder → final image. Because it is open-weight, users can fine-tune it (LoRA, DreamBooth) and run it locally via ComfyUI or Automatic1111.

  2. Midjourney (2022, closed-source): A proprietary diffusion model accessed via Discord or a web interface. It is known for high aesthetic quality and artistic style. Users type /imagine prompt: ... and receive a 2×2 grid of candidates. It does not expose weights; all inference happens on Midjourney's cloud. Parameters like --ar (aspect ratio), --stylize, and --chaos control output.

  3. DALL-E (OpenAI, 2021/2023): DALL-E 2 uses a diffusion model with a CLIP-guided prior; DALL-E 3 (2023) integrates directly with ChatGPT and uses a proprietary diffusion backbone. It excels at following complex compositional instructions (e.g., "a red fox sitting on a blue chair in a kitchen"). Access is via API or ChatGPT Plus.

Hallucination in LLMs:

A hallucination occurs when the model generates a confident but factually incorrect statement. For example, an LLM may cite a non-existent paper or invent a historical date. The root cause is that LLMs are next-token predictors optimised for fluency, not truth. The probability P(wt∣w1,…,wt−1)P(w_t \mid w_1, \ldots, w_{t-1}) rewards plausible-sounding continuations regardless of factual accuracy.

Knowledge Cutoff:

Every LLM is trained on a fixed corpus that ends at a specific date (e.g., GPT-4's cutoff is April 2023). Events after that date are unknown to the model. If asked about a 2025 election result, the model either refuses or hallucinates. This is a hard boundary — no amount of prompting can extend it without retraining or retrieval-augmented generation (RAG).

Feature Stable Diffusion Midjourney DALL-E 3
Open-source? Yes (weights public) No No
Runs locally? Yes (GPU ≥ 8 GB) No (cloud only) No (API only)
Fine-tunable? Yes (LoRA, DreamBooth) No No
Best for Custom pipelines, research Artistic / aesthetic output Complex compositional prompts
Access Hugging Face, ComfyUI Discord / Web OpenAI API / ChatGPT

Result: AI image generation transforms text into pixels via learned denoising. Stable Diffusion offers open control, Midjourney delivers aesthetic polish, and DALL-E 3 handles complex instructions. Hallucination and knowledge cutoff are fundamental LLM limitations that demand verification and disclosure in academic work.

Tip from Examiner: In the 7-mark answer, always write the diffusion formula $x_t = \sqrt{\alpha_t}\,x_0 + \sqrt{1-\alpha_t}\,\epsilon$ — it earns 1–2 marks instantly. For hallucination, give ONE concrete example (e.g., "LLM cited a 2019 paper that does not exist"). For knowledge cutoff, state the specific date for one model. Common mistake: confusing DALL-E (generation) with image classifiers (recognition) — they are opposite tasks.

Key Points

  • AI image generation synthesises new images from text prompts using diffusion or autoregressive models
  • Stable Diffusion is open-source, runs locally, and operates in latent space via a U-Net denoiser
  • Midjourney is closed-source, cloud-only, accessed via Discord, known for artistic quality
  • DALL-E 3 (OpenAI) handles complex compositional prompts and integrates with ChatGPT
  • Hallucination = confident false output because LLMs optimise fluency, not factual truth
  • Knowledge cutoff = training data ends at a fixed date; events after are unknown without RAG
Q4(a)7MUnit 4 — AI in Electrical and Electronics
Survival ModePredicted

(a) Explain AI applications in electrical/electronics and CSE domains, including smart grids, fault detection, VLSI design automation, code generation, and cybersecurity.

AI Applications in Electrical/Electronics and CSE

  1. Smart Grids – Time‑series forecasting (ARIMA, LSTM) predicts load and weather‑dependent demand; optimisation algorithms schedule generation, storage, and demand‑response to minimise cost and emissions.
  2. Fault Detection – Sensor streams (current, voltage, vibration) are fed into supervised models (CNN, SVM) that learn healthy baselines; deviations beyond a learned threshold trigger alarms.
  3. VLSI Design Automation – Reinforcement learning agents explore floor‑planning and placement; evolutionary algorithms optimise routing to reduce area and power.
  4. Code Generation (GitHub Copilot) – Large language models (GPT‑4) trained on public codebases suggest syntactically correct snippets, auto‑complete functions, and refactor code, boosting developer productivity.
  5. Cybersecurity – Anomaly‑detection models (auto‑encoders, RNNs) monitor network traffic; intrusion‑detection systems flag malicious patterns, while AI‑driven threat‑intel aggregates indicators of compromise.

Key Formula / Principle

Prediction Error (MAE): MAE=1n∑i=1n∣y^i−yi∣\text{MAE}=\frac{1}{n}\sum_{i=1}^{n}\lvert\hat{y}_i-y_i\rvert

Step‑by‑Step Example – Smart Grid Load Forecast

  1. Collect historical load L(t)L(t) and weather W(t)W(t).
  2. Train LSTM: L^(t+1)=f(L(t),W(t))\hat{L}(t+1)=f(L(t),W(t)).
  3. Evaluate MAE on validation set.
  4. Use forecast L^\hat{L} in optimisation: minimise ∑tcg(Gt)+cs(St)\sum_{t}c_g(G_t)+c_s(S_t) subject to Gt+St=L^(t)G_t+S_t=\hat{L}(t).

Result: AI transforms grid operation from reactive to proactive, reducing curtailment and improving reliability.

Tip from Examiner: Mark‑split: 2 marks for smart grids, 1 for fault detection, 1 for VLSI, 1 for code generation, 1 for cybersecurity. Common mistake: confusing forecasting with optimisation—state both.

Key Points

  • ARIMA/LSTM for load forecasting
  • CNN for fault detection
  • RL for VLSI floor‑planning
  • GPT‑4 for code generation
  • Auto‑encoder for anomaly detection
  • MAE as performance metric
Q4(b)7MUnit 4 — AI in Biotechnology and Healthcare
Core Concept

(b) Explain AI applications in biotechnology/healthcare and agriculture, including drug discovery, medical imaging, genomics, wearables, precision farming, crop monitoring, drone-based spraying, and soil analysis.

Concept / Given Data AI bridges engineering and life sciences by turning massive biological and agricultural data into actionable insights. In biotechnology it accelerates drug discovery, enhances medical imaging interpretation, decodes genomics, and powers wearable health monitors. In agriculture it enables precision farming, real‑time crop monitoring, drone‑based pesticide spraying, and soil‑property analysis.

Key Formula / Principle: AI Output=f(Input Data; θ)\text{AI Output}=f(\text{Input Data};\,\theta)

where ff denotes a trained model (e.g., deep neural network) and θ\theta are learned parameters.

Step‑by‑Step Solution / Working

  1. Data Acquisition – Collect high‑dimensional datasets: molecular structures, imaging voxels, genomic sequences, wearable sensor streams, satellite multispectral images, drone LiDAR scans, and soil moisture/electrical conductivity readings.
  2. Pre‑processing – Clean noise (e.g., Gaussian filter for MRI), normalize features, and encode categorical variables (one‑hot for gene alleles, SMILES strings for molecules).
  3. Feature Extraction / Representation – Use cheminformatics descriptors (ECFP4\text{ECFP}_4, MolLogP\text{MolLogP}) for drug candidates; convolutional layers extract texture from CT scans; recurrent networks embed genomic sequences; time‑series embeddings capture wearable vitals; NDVI indices summarise crop health.
  4. Model Training – Apply supervised learning (e.g., CNN\text{CNN} for image classification, GNN\text{GNN} for molecular activity) or unsupervised clustering (e.g., kk‑means on soil spectra) to learn θ\theta that maps inputs to desired outputs such as binding affinity, disease probability, or yield prediction.
  5. Prediction & Ranking – For drug discovery, compute predicted binding scores y^=f(molecule;θ)\hat{y}=f(\text{molecule};\theta). Rank candidates; select top‑nn for synthesis. In precision farming, predict per‑field nitrogen requirement N^=f(soil,weather;θ)\hat{N}=f(\text{soil},\text{weather};\theta) and generate variable‑rate fertilizer maps.
  6. Decision Support – Integrate AI outputs into expert systems: clinicians review AI‑annotated scans; agronomists adjust irrigation schedules; regulatory bodies assess safety of AI‑designed compounds.
  7. Feedback Loop – Continuously retrain models with new experimental/field data to improve accuracy and adapt to evolving conditions.

Result: AI transforms raw biological and agricultural data into predictive models that speed drug candidate selection, improve diagnostic accuracy, personalize health monitoring, and optimise farm inputs, thereby increasing productivity while reducing waste and time‑to‑market.

Tip from Examiner: Allocate marks – 1 for definition, 2 for data & preprocessing, 2 for model & prediction, 1 for decision impact, 1 for feedback loop. Avoid vague statements; cite at least one concrete AI technique per domain.

Key Points

  • AI accelerates drug discovery via predictive modelling of molecular activity
  • Medical imaging AI uses CNNs for automated segmentation and diagnosis
  • Genomics AI extracts patterns from DNA sequences for disease risk assessment
  • Wearables generate continuous health streams analysed by time‑series models
  • Precision farming AI predicts crop health and optimises inputs using satellite and drone data
Q5(a)7MUnit 5 — Assignment 5 (Unit V) Write 5 prompts for an engineering problem from your branch using: (a) Zero-shot (b) Few-shot (c) Chain-ofthought (d) Role prompting (e) Format-specific prompt
Survival ModePredicted

(a) A civil engineering student wants AI help to prepare a short report on crack detection in bridges. Write a well-structured prompt using role, context, task, format, and constraint. Also explain why each part improves the response.

A civil engineering student needs a short report on crack detection in bridges. Below is a well-structured prompt followed by a component-by-component explanation of why each slot improves the response.

Key Formula / Principle: Prompt=Role⏟who+Context⏟what/why+Task⏟do what+Format⏟how it looks+Constraint⏟limits\text{Prompt} = \underbrace{\text{Role}}_{\text{who}} + \underbrace{\text{Context}}_{\text{what/why}} + \underbrace{\text{Task}}_{\text{do what}} + \underbrace{\text{Format}}_{\text{how it looks}} + \underbrace{\text{Constraint}}_{\text{limits}}

The Prompt:

"Act as a senior civil engineer specialising in bridge health monitoring (Role). I am a final-year B.Tech student preparing a 2-page report for my Structural Engineering lab (Context). Write a short report on crack detection in reinforced-concrete bridges covering: (i) common crack types, (ii) visual vs. non-destructive detection methods, and (iii) one case study (Task). Use the following format: a 3-line introduction, three numbered sections with sub-bullets, and a 2-line conclusion (Format). Keep the total under 400 words, use plain language suitable for a lab instructor, and cite at least one standard (e.g., IS 456 or ACI 224) (Constraint)."

Why Each Part Improves the Response:

Step 1 — Role ("Act as a senior civil engineer…"): Anchors the model's vocabulary and depth to professional engineering discourse. Without it, the model may produce generic or overly academic text that lacks practical field terminology.

Step 2 — Context ("final-year B.Tech student… lab report"): Tells the model the audience and purpose, so it calibrates complexity — not too basic for a layperson, not research-paper level for a journal.

Step 3 — Task ("Write a short report covering…"): Removes ambiguity about what content to include. The three sub-topics act as a checklist the model must satisfy, preventing it from skipping a section.

Step 4 — Format ("3-line intro, three numbered sections, 2-line conclusion"): Guarantees a predictable structure the student can drop directly into a document without reformatting. This saves post-editing time.

Step 5 — Constraint ("under 400 words, plain language, cite one standard"): Prevents the model from over-generating or drifting into jargon. The citation requirement adds academic credibility and signals the expected rigour level.

Result: The five-slot prompt transforms a vague request ("tell me about bridge cracks") into a precise, reproducible instruction that yields a publication-ready draft in one pass, with minimal human editing.

Tip from Examiner: Always label each slot explicitly in your answer (Role, Context, Task, Format, Constraint) — examiners look for these five keywords. A common mistake is merging Context and Task into one sentence; keep them separate. Also, the constraint slot is where students lose marks by omitting a word limit or citation requirement; always include at least one measurable constraint.

Key Points

  • Five-slot prompt: Role + Context + Task + Format + Constraint
  • Role anchors vocabulary and professional depth
  • Context calibrates audience and complexity level
  • Task with sub-topics acts as a content checklist
  • Format ensures drop-in-ready structure without reformatting
  • Constraint (word limit, citation) prevents over-generation and adds rigour
Q5(b)7MUnit 5 — Prompt for different tasks
Core Concept

(b) Explain how prompt quality affects AI output. Compare prompts for summarisation, explanation, code generation, and brainstorming, giving one sample prompt for any two tasks.

Concept / Given Data Prompt quality is the degree to which a prompt follows the five‑slot anatomy: role, task, context, format and constraint. Small wording changes can shift the model’s internal conditioning, leading to markedly different completions even though the underlying model is identical.

Key Principle: Output  =  f(Model,  Prompt Quality)\text{Output}\;=\;f(\text{Model},\;\text{Prompt Quality})

Step‑by‑Step Comparison

  1. Summarisation – Goal: compress a long paragraph while preserving facts. A vague prompt like "Summarise this" often yields a generic paragraph. Adding clarity, length limit and audience improves fidelity.
    • Weak Prompt: "Summarise the article."
    • Improved Prompt: "Act as a civil engineer. Summarise the inspection report in 3 bullet points, each ≤12 words, focusing on safety‑critical findings."
  2. Explanation – Goal: elaborate a concept with logical flow. Without context the model may give a shallow answer.
    • Weak Prompt: "Explain Ohm’s law."
    • Improved Prompt: "Explain Ohm’s law for a first‑year EE student, step‑by‑step, and include a real‑world circuit example."
  3. Code Generation – Goal: produce syntactically correct, functional code. Missing language or style specifications cause mismatches.
    • Weak Prompt: "Write a Python script to read a CSV."
    • Improved Prompt: "Write a Python 3 script that reads a CSV file, handles missing values, and outputs the average of column ‘temperature’ using pandas."
  4. Brainstorming – Goal: generate diverse ideas. A narrow prompt restricts creativity.
    • Weak Prompt: "Give ideas for a renewable energy project."
    • Improved Prompt: "Act as a sustainable‑design consultant. Brainstorm 5 innovative renewable‑energy concepts for a rural Indian village, considering cost, local resources and maintenance."

Result: High‑quality prompts steer the model toward the intended scope, length, style and depth, reducing hallucinations and increasing relevance across tasks.

Tip from Examiner: In 2‑mark splits, allocate 1 mark for defining prompt quality and 1 mark for contrasting two task‑specific prompts; avoid generic statements.

Key Points

  • Prompt quality = role + task + context + format + constraint
  • Clear, constrained prompts yield focused, accurate outputs
  • Weak prompts produce generic or off‑target results