🌍 CS50x: Introduction to Computer Science · flashcards

CS50x: Introduction to Computer Science Artificial Intelligence Flashcards

50 question-and-answer cards covering Artificial Intelligence as it is examined in CS50x: Introduction to Computer Science. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.

50Cards in deck
24Free preview
8Syllabus topics
~245Chars per answer
FreePrice

24 sample cards from the Artificial Intelligence deck

Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.

  1. What biological system inspired artificial neural networks, and what is the analogy?

    The brain's network of neurons. Artificial units are analogous to neurons, and the weighted connections between units are analogous to synapses: each unit receives signals, and if the combined input is strong enough it "activates" and passes a signal onward.

  2. What are the three types of layers in a typical neural network?

    The input layer (receives the feature values), one or more hidden layers (intermediate units that learn internal representations), and the output layer (produces the final prediction).

  3. Write the formula for the output of a single artificial neuron with inputs $x_1,\dots,x_n$.

    $$h(x) = g\left(\sum_{i=1}^{n} w_i x_i + b\right)$$ where $w_i$ are the weights, $b$ is the bias, and $g$ is the activation function applied to the weighted sum.

  4. What is an activation function? Give two common examples with their formulas.

    A function applied to a unit's weighted sum that determines its output and introduces non-linearity. Examples: the sigmoid $\sigma(x)=\frac{1}{1+e^{-x}}$, which squashes values into $(0,1)$, and ReLU, $g(x)=\max(0,x)$, which passes positive values and zeroes out negatives.

  5. How is a neural network trained, at a high level?

    By gradient descent: the network makes predictions on training data, a loss function measures the error, and the weights are repeatedly adjusted in the direction that decreases the loss, i.e., $w \leftarrow w - \alpha \cdot \frac{\partial L}{\partial w}$, where $\alpha$ is the learning rate.

  6. What is backpropagation?

    The algorithm for training multilayer neural networks: it propagates the output error backward through the network, layer by layer, using the chain rule to compute the gradient of the loss with respect to every weight, so hidden-layer weights can be updated by gradient descent.

  7. What is a deep neural network?

    A neural network with multiple hidden layers between input and output. Each successive layer can learn increasingly abstract features, which is what "deep learning" refers to.

  8. Why are hidden layers and non-linear activations necessary in neural networks?

    A single unit with a linear function can only learn linearly separable decision boundaries. Hidden layers combined with non-linear activation functions allow the network to model complex, non-linear relationships between inputs and outputs.

  9. At its core, what task does a large language model (LLM) perform?

    Next-token prediction: given a sequence of text (the context), it outputs a probability distribution over the vocabulary for the most likely next token, then repeats this process token by token to generate text.

  10. What is a token in the context of LLMs?

    The basic unit of text an LLM processes — often a word, part of a word, or punctuation mark. Text is split into tokens before being fed to the model, and models have a maximum context window measured in tokens.

  11. What neural network architecture underlies modern LLMs, and what is its key mechanism?

    The transformer architecture, whose key mechanism is attention: it lets the model weigh how relevant every other token in the context is when interpreting or generating each token, capturing long-range relationships between words.

  12. What are word embeddings?

    Representations of tokens as high-dimensional numeric vectors that capture meaning: words with similar meanings map to vectors that are close together, allowing the model to compute with semantic relationships mathematically.

  13. How is an LLM trained, at a high level?

    In pretraining, the model is shown massive text corpora and its billions of weights (parameters) are tuned by gradient descent to predict the next token accurately. It is then typically fine-tuned — e.g., with reinforcement learning from human feedback (RLHF) — to be more helpful and follow instructions.

  14. Why does the attention mechanism matter for understanding a sentence like "The dog didn't cross the street because it was too tired"?

    Attention lets the model determine which earlier word "it" refers to (the dog, not the street) by assigning high relevance weights between "it" and "dog," resolving ambiguity using the whole context rather than only nearby words.

  15. What is the temperature parameter in LLM text generation?

    A setting that controls randomness when sampling the next token from the probability distribution: low temperature makes the model pick the most likely tokens (more deterministic, focused output), while high temperature flattens the distribution (more varied, creative output).

  16. What is prompt engineering?

    The practice of deliberately crafting the input text (prompt) given to an LLM — its wording, structure, context, and examples — to steer the model toward more accurate, relevant, and useful outputs.

  17. What is the difference between a system prompt and a user prompt?

    A system prompt is an instruction set by the developer that defines the model's role, rules, and behavior for the whole conversation (e.g., "You are a helpful tutor; never give away answers"). A user prompt is the message the end user actually types for the model to respond to.

  18. Compare zero-shot and few-shot prompting.

    Zero-shot prompting asks the model to perform a task with instructions only and no examples. Few-shot prompting includes a handful of worked input–output examples in the prompt, which usually improves accuracy because the model can imitate the demonstrated pattern.

  19. What is chain-of-thought prompting and why does it help?

    Prompting the model to reason step by step (e.g., "think through this step by step") before giving its final answer. Generating intermediate reasoning tokens improves performance on multi-step problems like math and logic, since each step conditions the next.

  20. Why does adding context and constraints to a prompt improve LLM output?

    Because the model generates text conditioned on everything in its context window: relevant background, explicit requirements, desired format, and examples narrow the space of plausible continuations, making the statistically likely output also the correct and useful one.

  21. What is a hallucination in the context of LLMs?

    When a model confidently generates text that is false or fabricated — invented facts, citations, dates, or events — that sounds plausible and fluent but does not correspond to reality.

  22. Why do LLMs hallucinate?

    Because they are trained only to produce statistically plausible next tokens, not to verify truth: they have no built-in fact database or fact-checking step, so when the training data is sparse or the question is ambiguous, a fluent but false continuation can be the most probable output.

  23. Name three key limitations of LLMs besides hallucination.

    (1) Knowledge cutoff: they know nothing about events after their training data ends. (2) Bias: they can reproduce biases present in their training text. (3) No true understanding or guaranteed reasoning: they can fail at arithmetic, logic, and consistency, and they cannot verify their own claims.

  24. What strategies help mitigate hallucinations when using an LLM?

    Verify important claims against authoritative sources; ask the model for citations and check them; ground the model with retrieved documents (retrieval-augmented generation, RAG) or provide the relevant facts in the prompt; and avoid relying on unverified output for high-stakes decisions.

What this deck covers

The Artificial Intelligence deck follows the CS50x: Introduction to Computer Science Artificial Intelligence syllabus — 3 chapters and 8 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 16.7 cards per chapter.

Answers are written to be recallable, not just readable — averaging about 245 characters, which is long enough to carry the reasoning and short enough to say out loud.

A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.

Artificial Intelligence flashcards FAQ

How many Artificial Intelligence flashcards are in this CS50x: Introduction to Computer Science deck?

50 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.

Are these CS50x: Introduction to Computer Science flashcards free?

Yes. The preview here is free to read with no signup, and the full 50-card deck is free inside the Examius app.

What do the Artificial Intelligence cards cover?

They follow the CS50x: Introduction to Computer Science Artificial Intelligence syllabus — 3 chapters and 8 topics — so the questions track what is actually examinable.

How should I use these flashcards?

Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.