1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Machine Learning Overview

  • 42Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Foundations of Search

What does a learning algorithm take as input and what does it return?

42 questions

  1. 1

    What does a learning algorithm take as input and what does it return?

    Model answer

    A learning algorithm takes training data (input/output pairs) and returns a predictor.

    Explanation

    The predictor maps new inputs to outputs, enabling the system to generalize from the training data.

  2. 2

    What is the difference between the output of a regression model and a classification model?

    Model answer

    Regression outputs a number, while classification outputs one of k options, also called a class or label.

    Explanation

    Regression predicts continuous values; classification predicts discrete categories.

  3. 3

    What are the four ingredients of intelligence mentioned in the lecture?

    Model answer

    Perception, reasoning, action, and learning.

    Explanation

    These components are the building blocks of intelligent systems.

  4. 4

    How does a predictor relate to the ingredients of intelligence?

    Model answer

    A predictor covers the bottom part of the ingredients, reflexively mapping percepts to actions, and this mapping is learned directly.

    Explanation

    It does not involve explicit reasoning; it's a direct mapping from perception to action.

  5. 5

    In what kind of world is search used as a form of reasoning?

    Model answer

    Search is used when the world is deterministic.

    Explanation

    In deterministic worlds, the outcome of actions is predictable, making planning feasible.

  6. 6

    Give two concrete examples of problems that require search.

    Model answer

    Finding a sequence of moves to solve a Rubik's cube and finding the shortest path from point A to point B.

    Explanation

    Both require planning and exploring multiple possibilities.

  7. 7

    What is the main message of the Bitter Lesson by Rich Sutton?

    Model answer

    General methods that leverage computation are ultimately the most effective, by a large margin.

    Explanation

    Sutton argues that handcrafted prior knowledge is often outperformed by general methods with more computation.

  8. 8

    According to the Bitter Lesson, which two methods scale arbitrarily?

    Model answer

    Search and learning.

    Explanation

    These are the pillars that can leverage increasing computation.

  9. 9

    What is the limitation of search alone, according to the lecture?

    Model answer

    Search alone cannot solve problems; it needs to be coupled with learning.

    Explanation

    Learning provides powerful models, and combining them with search yields powerful systems.

  10. 10

    What are the three essential components of a search problem?

    Model answer

    Start state, successors function, and isEnd function.

    Explanation

    These define the problem formally: where you start, what actions you can take, and when you have reached a goal.

  11. 11

    What does the successors function return?

    Model answer

    It returns a list of steps, each consisting of an action, the cost of that action, and the resulting state.

    Explanation

    This defines the transitions from any given state.

  12. 12

    In the travel search problem, what are the two possible actions and their costs?

    Model answer

    Walk costs 1 minute and goes from i to i+1; tram costs 2 minutes and goes from i to 2i.

    Explanation

    These actions are defined for the problem of traveling from 1 to n.

  13. 13

    What is the objective of a search problem?

    Model answer

    To find a solution, which is a sequence of actions that minimizes the total cost.

    Explanation

    The solution must lead from the start state to an end state.

  14. 14

    Why is it important to include more than just the current location in the state when adding constraints?

    Model answer

    The state must contain any information needed to evaluate future actions, costs, and successors.

    Explanation

    For example, to enforce a ticket limit, the state must include the number of tickets remaining.

  15. 15

    How should the state be modified to incorporate a constraint that each tram ride consumes a ticket?

    Model answer

    The state should include both the current location and the number of tickets remaining.

    Explanation

    The successors function then only allows the tram action if tickets > 0, and decrements tickets.

  16. 16

    How should the state be modified to incorporate a constraint that the tram cannot be taken twice in a row?

    Model answer

    The state should include a field indicating whether the last action was taking the tram.

    Explanation

    Then, if the last action was tram, the tram action is not allowed.

  17. 17

    What is a potential drawback of including the full history in the state?

    Model answer

    It can lead to an exponential number of states, making algorithms like dynamic programming intractable.

    Explanation

    Keeping the state as small as possible improves efficiency.

  18. 18

    Define the future cost function for a state in a search problem.

    Model answer

    The future cost of a state is the minimum cost of reaching an end state from that state.

    Explanation

    It is a function that helps solve the problem recursively.

  19. 19

    Write the recurrence for the future cost function.

    Model answer

    F(s)=min⁡(a,c,s′)∈successors(s)(c+F(s′))F(s) = \min_{(a, c, s') \in \text{successors}(s)} (c + F(s'))F(s)=min(a,c,s′)∈successors(s)​(c+F(s′))

    Explanation

    The future cost of state s is the minimum over all successors of the immediate cost plus the future cost of the resulting state.

  20. 20

    What is the base case for the future cost recurrence?

    Model answer

    F(s)=0F(s) = 0F(s)=0 if sss is an end state.

    Explanation

    At an end state, no further actions are needed, so the cost is zero.

  21. 21

    What is the worst-case time complexity of exhaustive search?

    Model answer

    Exponential in the number of states.

    Explanation

    Because it explores all possible paths, which can be exponential.

  22. 22

    How can cycles be handled in exhaustive search?

    Model answer

    By including a step count in the state and setting a maximum number of steps as a threshold.

    Explanation

    This ensures the search terminates, but the threshold must be chosen carefully.

  23. 23

    What is the key idea of dynamic programming in the context of search?

    Model answer

    Dynamic programming is exhaustive search with caching (memoization): solutions from each state are stored and reused.

    Explanation

    This avoids recomputing future costs for states that are reached multiple times.

  24. 24

    What tradeoff does dynamic programming introduce compared to exhaustive search?

    Model answer

    It reduces time complexity at the cost of memory, which must be proportional to the number of states.

    Explanation

    If the number of states is too large, dynamic programming may not be feasible.

  25. 25

    When is dynamic programming most beneficial?

    Model answer

    When many different paths lead to the same state, creating a lattice structure.

    Explanation

    Then caching repeatedly reused states yields significant speedup.

  26. 26

    Name two approximate search algorithms discussed in the lecture.

    Model answer

    Best-of-n and beam search.

    Explanation

    Both are heuristic methods used when exact search is intractable.

  27. 27

    What is a policy in the context of search?

    Model answer

    A policy is a function that maps a state to an action (deterministic or random).

    Explanation

    Policies are used in best-of-n to generate rollouts.

  28. 28

    What is a rollout?

    Model answer

    A rollout is the application of a policy from the start state to an end state, producing a solution.

    Explanation

    Each rollout is a sample path through the state space.

  29. 29

    How does the best-of-n algorithm work?

    Model answer

    It samples n rollouts using a policy and returns the solution with the lowest cost.

    Explanation

    It is simple and parallelizable.

  30. 30

    What guarantee does best-of-n have as the number of rollouts n goes to infinity?

    Model answer

    It converges to the optimal solution, provided the policy has positive probability on all actions.

    Explanation

    Exact convergence may require exponentially many rollouts.

  31. 31

    What is a key advantage of best-of-n over beam search?

    Model answer

    It is embarrassingly parallel because each rollout is independent.

    Explanation

    No communication between rollouts is needed.

  32. 32

    How does beam search work?

    Model answer

    It maintains a set of beam width partial solutions; at each step, it expands all candidates, evaluates their cost, and keeps only the top beam width solutions.

    Explanation

    This prunes the search space deterministically.

  33. 33

    What does beam search reduce to when beam width is 1?

    Model answer

    Greedy search.

    Explanation

    Only the best partial solution is kept at each step.

  34. 34

    What happens as beam width goes to infinity?

    Model answer

    Beam search becomes exhaustive search, but with exponential memory usage.

    Explanation

    It is not a practical approach.

  35. 35

    Is beam search deterministic or stochastic?

    Model answer

    Deterministic.

    Explanation

    Given the same candidates and cost function, it always returns the same result.

  36. 36

    In what way do best-of-n and beam search differ in what they require?

    Model answer

    Best-of-n requires a policy to guide rollouts, while beam search uses the cost function directly.

    Explanation

    If you have a good policy, best-of-n can be effective; otherwise, beam search may be preferred.

  37. 37

    In the language model search problem, what is the state?

    Model answer

    The state is a string consisting of the prompt plus the prefix of the response generated so far.

    Explanation

    This captures all necessary context for generating the next token.

  38. 38

    What is the action in a language model search problem?

    Model answer

    Predicting the next token.

    Explanation

    The action space is the vocabulary of the language model.

  39. 39

    What is the cost of an action in a language model search problem?

    Model answer

    The negative log probability of the next token.

    Explanation

    Minimizing cost corresponds to maximizing probability.

  40. 40

    How can a verifier be incorporated into the cost function?

    Model answer

    If the verifier determines the response is correct, a large negative bonus (e.g., -100) is added to the cost.

    Explanation

    This incentivizes solutions that pass the verifier.

  41. 41

    What is test-time compute in the context of language models?

    Model answer

    Using additional computation at test time to improve the quality of generated responses, for example by sampling multiple candidates.

    Explanation

    This approach has been popularized by models like OpenAI's o1.

  42. 42

    How does best-of-n sampling work for language models?

    Model answer

    It uses the language model as a policy to sample multiple complete responses, then selects the one with the lowest cost (highest probability or verifier bonus).

    Explanation

    This is a simple but effective test-time compute strategy.

1 of 42
Question 1 of 42

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent