Prev: L25, Next: L27
Course Links: Canvas, Piazza, TopHat (212925)
Zoom Links: MW 4:00, TR 1:00, TR 2:30.
Tools
📗 You can expand all TopHat Quizzes and Discussions: , and print the notes: , or download all text areas as text file: .
📗 For visibility, you can resize all diagrams on page to have a maximum height that is percent of the screen height: .
📗 Calculator:
📗 Canvas:


Slide:




# Genetic Algorithm

📗 Genetic algorithm starts with a fixed population of initial states, and the successors are found through cross-over and mutation: Wikipedia.
📗 Each state in the population with \(N\) states has probability of reproduction proportional to the fitness (or negatively proportional to the costs): \(p_{i} = \dfrac{f\left(s_{i}\right)}{f\left(s_{1}\right) + f\left(s_{2}\right) + ... + f\left(s_{N}\right)}\).
📗 If the states are encoded by strings, cross-over means swapping substrings at a fixed point: for example, abcde and ABCDE cross-over at position 2 results in abCDE and ABcde: Wikipedia.
📗 If the states are encoded by strings, mutation means randomly updating substrings with a small probability called the mutation rate: for example, abcde can be updated to abCde or aBcDe or ... with small probabilities: Link
📗 Genetic algorithm: in each generation, the reproduction process is:
➩ Randomly sample two states based on the reproduction probabilities.
➩ Cross-over these two states to produce two children states.
➩ Mutate these two states with small probabilities.
➩ Repeat the process until the same population size is reached, and continue to the next generation.
TopHat Quiz (Past Exam Question) ID:
📗 [4 points] When using the Genetic Algorithm, suppose the states are \(\begin{bmatrix} x_{1} & x_{2} & ... & x_{T} \end{bmatrix}\) = , , , . Let \(T\) = , the fitness function (not the cost) is \(\mathop{\mathrm{argmax}}_{t \in \left\{0, ..., T\right\}} x_{t} = 1\) with \(x_{0} = 1\) (i.e. the index of the last feature that is 1). What is the reproduction probability of the first state: ?
📗 Answer: .




# Variants of Genetic Algorithm

📗 The parents do not survive in the standard genetic algorithm, but if reproduction between two copies of the same states is allowed, the parents can survive.
📗 The fitness or cost functions can be replaced by the ranking.
➩ If state \(s_{i}\) has the \(k\)-th lowest fitness value among all states, the reproduction probability can be computed by \(p_{i} = \dfrac{k}{1 + 2 + ... + N}\).
📗 In theory, cross-over is much more efficient than mutation.
Example
📗 Many problems can be solved by genetic algorithm (but in practice, reinforcement learning techniques are more efficient and produce better policies).
➩ Walkers: Link.
➩ Cars: Link.
➩ Eaters: Link.
➩ Image: Link.



# State Representation of Neural Networks

📗 A neural network can be represented by a sequence of weights (a single state).
📗 Two neural networks can swap a subset of weights (cross-over).
📗 One neural networks can randomly update a subset of weights with small probability (mutation).
📗 Genetic algorithm can be used to train neural networks to perform reinforcement learning tasks.
Example
📗 Flappy bird: Link, Link.
📗 Cars: Link.




# Dual Use of AI

📗 Drug discovery: flip the objective function to make optimization find many highly toxic compounds: Link (drug discovery), PDF (toxic chemical).
📗 Image generation: deepfake (fake videos and face images): Wikipedia, Link (this person does not exist), Link (2024 election).
📗 Robotics: Wikipedia, Link (autonomous weapons), Link (UW Robotics).



# AI Ethics

📗 Bias and fairness: Link (fairness and bias), PDF (gender bias), PDF (racial bias).
➩ Collect representative data from minority groups.
➩ Remove bias associations
➩ Add fairness constraints to the optimization problem for learning.
📗 Fake content
📗 Privacy: Link (Netflix de-anonymization attack), Link (social network)
➩ Right to be forgotten (deep networks need to unlearn)
➩ Differential privacy (done by adding noise to dataset)
📗 Adversarial robustness: Link (turtle or rifle), Link (black box attack), Link (LLM attack).
➩ Training time attack (fake training data)
➩ Test time attack (adversarial training to defend)
📗 Value alignment: Link (value alignment).
📗 Other recommended readings:
➩ Weapons of Math Destruction: Wikipedia
➩ Concrete Problems in AI Safetfy: PDF
➩ On the Dangers of Stochastic Parrots: Link



📗 Notes and code adapted from the course taught by Professors Jerry Zhu, Yingyu Liang, and Charles Dyer.
📗 Content from note blocks marked "optional" and content from Wikipedia and other demo links are helpful for understanding the materials, but will not be explicitly tested on the exams.
📗 Please use Ctrl+F5 or Shift+F5 or Shift+Command+R or Incognito mode or Private Browsing to refresh the cached JavaScript.
📗 You can expand all TopHat Quizzes and Discussions: , and print the notes: , or download all text areas as text file: .
📗 If there is an issue with TopHat during the lectures, please submit your answers on paper (include your Wisc ID and answers) or this Google form Link at the end of the lecture.
📗 Anonymous feedback can be submitted to: Form.

Prev: L25, Next: L27





Last Updated: December 10, 2024 at 3:36 AM