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

  • 45Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Search Problem Definition
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What are the three components of a search problem?

Tap to flipClick to flipspace

Start state, successors function, and isEnd function.

Or swipe the card

45 cards

  1. What are the three components of a search problem?

    Start state, successors function, and isEnd function.

  2. What does the successors function return?

    A list of steps, each containing an action, the cost of that action, and the resulting state.

  3. What is the objective of a search problem?

    Find a sequence of actions from the start state to an end state that minimizes the total cost.

  4. Why must the state contain enough information?

    To evaluate future actions, costs, and successors correctly.

  5. How would you model limited tram tickets in a search problem?

    Include the number of tickets in the state. Walking does not change tickets; taking the tram decrements tickets. Only add the tram step if tickets > 0.

  6. How would you model the constraint 'cannot take the tram twice in a row'?

    Add a field to the state indicating whether the last action was taking the tram. Then, only allow the tram if that field is false.

  7. Why should you keep the number of states small?

    Because algorithms like dynamic programming scale with the number of states; a large state space leads to slow or intractable computation.

  8. What is a policy in the context of search?

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

  9. What is exhaustive search?

    An algorithm that tries all possible sequences of actions and returns the one with the minimum total cost.

  10. What is future cost?

    The cost of the minimum-cost solution from a given state to an end state.

  11. Write the recurrence for future cost.

    futureCost(s)=min⁡(a,c,s′)∈successors(s)(c+futureCost(s′))\text{futureCost}(s) = \min_{(a, c, s') \in \text{successors}(s)} (c + \text{futureCost}(s'))futureCost(s)=min(a,c,s′)∈successors(s)​(c+futureCost(s′)) with base case futureCost(end)=0\text{futureCost}(\text{end}) = 0futureCost(end)=0.

  12. What is the time complexity of exhaustive search?

    Worst-case exponential in the number of states.

  13. What is the memory complexity of exhaustive search?

    Linear in the length of the solution (due to the recursion stack).

  14. How does exhaustive search handle cycles?

    It does not; cycles cause infinite recursion. To avoid this, add the number of steps to the state and set a maximum step limit. States exceeding the limit get infinite cost.

  15. Why might exhaustive search explore the same state multiple times?

    Because different paths can converge to the same state, and there is no caching of results.

  16. What is dynamic programming in the context of search?

    Exhaustive search plus caching (memoization) of future costs.

  17. What three changes turn exhaustive search into dynamic programming?

    1. Introduce a cache (e.g., dictionary). 2. At the start of the function, check if the state is in the cache; if so, return the cached result. 3. After computing the result, store it in the cache.
  18. What is the time complexity of dynamic programming?

    Proportional to the number of states (each state is computed once).

  19. What is the memory complexity of dynamic programming?

    Proportional to the number of states (to store the cache).

  20. When does dynamic programming provide significant speedup over exhaustive search?

    When many different paths converge to the same state, so that caching avoids repeated computation of the same subproblem.

  21. When is dynamic programming not beneficial?

    When each action leads to a unique state (a tree structure), so no state is visited more than once. Then caching provides no benefit.

  22. What is a caveat of dynamic programming?

    Memory usage is proportional to the number of states. If the state space is huge (e.g., trillions of states), it may not fit in memory.

  23. Why use approximate search?

    Exact search (e.g., exhaustive or dynamic programming) is intractable for very large state spaces; approximate search uses heuristics to find good solutions quickly.

  24. Name two approximate search algorithms discussed.

    Best of n and beam search.

  25. What is the key trade-off in approximate search?

    It may miss the optimal solution, but it can handle problems where exact search is infeasible.

  26. What is best of n?

    Perform n independent random rollouts (sampling actions according to a policy), collect the resulting solutions, and return the one with the lowest total cost.

  27. What is a rollout?

    Applying a policy from the start state to an end state, recording the sequence of actions and cumulative cost.

  28. What property makes best of n embarrassingly parallel?

    Each rollout is independent; they can be run simultaneously on different machines with no communication.

  29. Under what condition does best of n converge to the optimal solution as n → ∞?

    If the policy assigns positive probability to every action at every state, then as n grows, the best solution found converges to the optimal.

  30. What is a potential drawback of best of n?

    It may require exponentially many rollouts to find the optimal solution, especially if the optimal path has low probability under the policy.

  31. How is a policy used in best of n?

    The policy maps each state to a distribution over actions; during a rollout, actions are sampled from this distribution.

  32. What is beam search?

    An algorithm that maintains a set of k partial solutions (the beam). At each step, it expands all candidates by considering all possible next actions, then keeps only the k best (lowest cost) candidates.

  33. What happens when the beam width is 1?

    Beam search reduces to greedy search: at each step, only the single best action is taken.

  34. What happens as beam width → ∞?

    Beam search becomes exhaustive search, as no candidates are pruned.

  35. Is beam search deterministic or stochastic?

    Deterministic.

  36. How does beam search handle states that reach an end state early?

    They are kept in the candidate list and not expanded further. They compete with other candidates for the best final solution.

  37. What is a common trick to handle cycles in beam search?

    Limit the maximum number of steps; after that, candidates are terminated.

  38. What is test-time compute for language models?

    Using additional computation at inference time to improve the quality of generated responses, e.g., by searching over multiple completions.

  39. How can best of n be applied to language models?

    Sample multiple completions from the language model (using the model's probability distribution as the policy), then select the best one according to a cost function (e.g., negative log probability plus a verifier bonus).

  40. In a language model search problem, what is the state?

    The prompt concatenated with the prefix of the response generated so far (a string).

  41. In a language model search problem, what is the action?

    Predicting the next token (i.e., choosing a token from the vocabulary).

  42. In a language model search problem, what is the cost?

    The negative log probability of the chosen token given the current state.

  43. How can a verifier be incorporated into the cost?

    Add a large negative cost (e.g., -100) if the verifier determines the response is correct.

  44. What is the relationship between search and learning highlighted in the lecture?

    Costs can be learned from data (e.g., language model probabilities), and search finds the best solution given those learned costs. Combining search with learned models yields powerful systems.

  45. What does Rich Sutton's Bitter Lesson state?

    General methods that leverage computation are ultimately the most effective, and by a large margin. The two methods that seem to scale arbitrarily are search and learning.

Card 1 of 45
Card 1 of 45

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent