Thursday, July 23, 2020

GPT-3

There's been a lot of buzz recently about GPT-3, the "Generative Pretrained Transformer" from OpenAI. While they open-sourced the previous version, GPT-2, this version will instead be offered as a commercial API. They plan to make it easy to use so it will likely be integrated into many applications.

While the API is in closed beta, you can try out a version of it on AI Dungeon. AI Dungeon is geared at text adventure games but can be used for anything. I tried it out by asking Turing-test-style questions to see how well it "understands" the world. Initially I was not so impressed as I posted to Reddit. However there were a few things I missed:

  • AI Dungeon uses by default a hybrid between GPT-2 and GPT-3. Once I updated it to use the "dragon" model (and reduced the randomness), it switched to full GPT-3 and the results improved.
  • For some questions, GPT-3 needs to be primed in that category before being asked a question. For example, it can solve simple math questions if it's given a few examples first. I think this is impressive since in the future it may be able to answer the questions without the priming and meanwhile specific applications can fine-tune it. 
  • A commenter on Reddit reported using the actual API and getting a better result for one or two of the questions. It's possible that AI Dungeon primes GPT-3 to answer prompts in a certain style and this causes it to do more poorly on general questions. 
With the right settings in place GPT-3 is able to answer a ride range of questions, including questions involving ambiguous grammar. For example here are my questions and its answers:
Q: Arjun lived in an Indian jungle. One night he heard a noise, went outside and shot a bear in his pajamas. Where was the bear?
A: The bear was in the jungle.
Q: Arjun lived in an Indian jungle. One night he woke up and squished a spider in his pajamas. Where was the spider?
A: The spider was in his pajamas.
I can see GPT-3 being useful in many applications from search engines to online tutorials. It can also be used for less noble purposes such as advanced spamming and trolling, but OpenAI plans to control usage of it carefully.

GPT-3 went from being basically ignored to over-the-top hype very quickly. While it's certainly impressive how much it can do, it'a quite far from a general AI that can do anything. It's still just a text predictor without a fundamental understanding of the world. For example, while it can answer comparison questions within a specific category, it struggles with cross-category comparisons, even after being primed for them. I asked it the following question after having provided it with similar questions and answers:
 Q: Which of these is largest? Planet Venus or an elephant?
It answered:
A: an elephant
I tried a few more similar questions but it consistently got them wrong. I assume the elephant wins most size comparisons on the internet, but it's still smaller than a planet. Assuming the standard API doesn't do better, this seems to be a large blindspot with GPT-3. Text prediction can answer many questions, but sometimes better knowledge is needed. It would be interesting if they can find a way to combine GPT-3's text prediction with a structured knowledge algorithm. In the meantime, humans are still needed. ~



Thursday, July 9, 2020

Why do Good?

Summary: Why do good? In many cases it's simpler to live life that way. Humans are not robots so they need straightforward heuristics to follow.

Should a person steal if they can get away with it?
Even for self-interested reasons, a person shouldn't wrong other people. There may be cases where the payoff from stealing beats the risk of getting caught, but people are not robots and it's not worth the anxiety to constantly look out for such cases or worry about getting caught afterwards. It's simpler to just be an overall good person. To quote Epicurus, whose ethics was self-interested, "The greatest reward of righteousness is peace of mind".

Why should you help other people?
Even for self-interested reasons, it's worthwhile to help your friends, relatives, neighbors and coworkers. This builds positive relationships and people will help you back in the future. However one shouldn't just do everything in a purely tit-for-tat manner since it's hard to calculate how you'll be paid back so it's simpler to just be helpful. People can also detect if someone is genuinely helpful or just Machiavellian and they want a friend who has their back, not someone who calculates the optimal Bayesian game-theoretic expected value of a good deed.

However, it's fair to avoid being taken advantage of so you don't need to treat freeloaders the same as those who contribute back. This also doesn't address whether one should help a stranger, which is discussed later.

Should you do a good job at work?
As an employee, you can think every moment about getting a good performance evaluation and not do anything that doesn't directly help that goal. However it's simpler to focus on doing a good job and aim to be helpful to your team and company. In a healthy company, employees who do this will be recognized. You also need to keep an eye on getting a good evaluation, but it doesn't need to be your entire focus.

Large companies generally require some kind of formal performance evaluation so they can maintain certain standards across the company and avoid freeloaders, but they also want a healthy culture so that employees care about doing a good job and don't just focus on the measure. With the right balance, the company can succeed and reduce the problems caused by Goodhart's Law.

Should companies do good?
A company can focus every moment on maximizing profit or it can focus on a higher goal such as providing a good product or service to its customers. In theory, focusing on profits should lead to higher overall profit than any other approach. However, profit-focused humans tend to aim for short-term profits at the expense of the longer term company value:
  • A small business doesn't refund a customer and ends up losing the customer and perhaps their friends. 
  • A public corporation focuses on quarterly results and ignores long-term R&D, customer satisfaction or employee retention.
While a perfect profit-focused algorithm may be able to factor everything into the long term value, humans don't think like that. It's simpler to focus on following certain values, such as always providing good customer service, even if it's more expensive in the short-term.

A country cannot run on companies providing products or services based on their goodwill alone. There will always be freeloaders, and ultimately people need competition and a profit motive to try their hardest. However a country cannot flourish if every company is entirely focused on maximizing profits. In a healthy economy, the companies that focus on providing a benefit to their customers (and society) are the companies that will succeed.

A culture of good
In short, it's simplest for the employee or company to keep a daily focus on doing good, while also keeping an eye on the metrics they're measured by (whether performance evaluations or profits). The company itself certainly wants employees to focus on doing good work, and countries certainly want companies to focus on providing good products and services.

How can companies and countries encourage good behavior? A large part of it comes down to cultural norms and expectations:
  • Joe joins a company where everyone only focuses on what's explicitly measured in their performance evaluation. Joe can then turn down all work not connected to his evaluation and no one will think less of him. 
  • Joe joins a company where people fix whatever needs to be fixed and help each other out. If Joe only works for his evaluation, employees may look down on him, and that can even end up harming his evaluation.
A large part of culture is self-reinforcing so it's important for a company to get this right early and hire helpful employees and encourage them to be helpful.

Why is good successful?
If doing good doesn't capture all of the ways an employee or company is evaluated, why is it the best thing to focus on? I think this also relates to culture and what people value:
  • If an employee does good work but misses some performance technicality, a healthy company will still give a positive evaluation. 
  • If a company is known to do fraud or bribery, it will be harder for them to retain employees and customers in a society that values justice.
In a country where bribery is the norm, there's much less risk from participating in it, since people expect everyone to do it anyway. This is why it's important to build good culturural norms. However it's hard for governments to control culture; unlike companies they don't even get to pick their members.

Not the only reason to do good
The above all focused on achieving success, but one should do good for its own sake. By doing good one can achieve more meaning and happiness than from material success. And only doing good is fully within one's control.

If people do good for its own sake, they will also do good to complete strangers, even if it can't be paid back. The doer won't get any reward from this but for their own eudaimonia. And the country or world with more of such people will flourish.

Ethical systems
Now that we've come to ethics for its own sake, what ethical system should one follow? If one wants the best outcome for the world, it seems one should be consequentialist. A perfect consequentialist algorithm could calculate the optimal action in every case to bring the greatest good to the most people. However humans are not robots, and it's easy to use consequentialist thinking to justify bad behavior:
  • It's OK to steal a little from the wealthy, I'll get more benefit from it anyways.
  • It's OK to trespass this private property, I'm not hurting anyone.
An algorithm could correctly factor in how even small actions of stealing and trespassing add up to worse consequences overall. But for humans, it's simpler to just follow ethical rules or try to live virtuously.


Wednesday, July 1, 2020

Biology to Learn

This is the sixth posts in the things to learn series. See the intro or the last post about biology vs. physics. This post lists interesting questions and topics in biology.
  • What is life? 
  • DNA and Genes
    • Expression - How does the genetic message go from DNA to RNA to proteins?
      • How do things like genetic dominance work at the chemical level?
    • Reproduction - How does DNA replicate? How does it ensure variation? It's almost paradoxical how much effort life spends to preserve DNA and then also to mix it up. 
      • Multiple swaps happen during meiosis
      • How are traits inherited? (From Mendelian single-gene traits to more complex multi-gene traits)
    • Differentiation - How do cells differentiate during fetal development?
      • Initial impetus based on amount of fluid detected in egg/fetus, which then sets off chain reaction where genes signal to other genes. (Seems almost recursive. How did this process evolve?)
    • A bit on modern techniques for editing DNA
      • Old tech to transfer genes from one organism to another
      • CRISPR
    • Bigger picture of genetic differences. What does it mean that humans share ~50% of their DNA with a banana or 99.9% of their DNA with each other? How much do people differ from each other? What does that mean? How relevant is the non-coding DNA. 
      • Seems us humans are not really 99.9% the same. Even just in coding DNA, letter differences change whole words and CNVs repeat words.
    • Practical things can one learn from getting your DNA test 
    • What genes led humans to be so different than e.g. chimpanzees. How a small number of genes can make a large difference in the brain's development. How non-coding DNA affects things. 
  • Evolution
    • Quantitative evolution -  Rates of mutations of DNA of different organisms. How long it takes for an adaptive gene to spread in a population. To what extent can the path of evolution be traced?
    • The possible origins of the first life
    • The role of epigenetics 
    • Philosophy of evolution
    • What level evolution occurs at and how animals cooperate (see The Selfish Gene)
    • Evolutionary psychology - how much actual evidence vs. speculation. Seems in many areas the brain is general purpose and people can adapt without genetic mutations.
      • Related: philosophical interpretations of human nature
  • The brain
    • How can thoughts and memories arise from neurons? (This is understood to a certain extent.)
    • How does consciousness work? (Difficult question!)
      • How do Buddhist meditative views on consciousness relate to the scientific nature of the brain. (See Why Buddhism is True)
      • To what extent are different animals conscious? Very simple animals (e.g. hydras) are not, and mammals appear to be but what about in-between?
    • How did and does the brain develop (evolution, culture, nature, nurture)
    • What happens to the brain during sleep?
      • Why is it so important for health?
      • Can dreams be interpreted as random neurons firing?
    • To what extent is the brain hardwired when born vs. a system that learns? 
      • Brain starts in very flexible state, but people eventually lose the ability to learn things like vision and speech. Some people can control extra fingers (See polydactyly.) What else could be wired to brain? Brain needs to be general purpose to have evolved.
    • Computational neuroscience - how does the brain compare to artificial neural networks? Besides direct neurons firing, what else in the brain is used for processing?
    • Behavioral neuroscience - To what extent does understanding the physical mechanisms of the brain help with understanding human psychology? In general, can the mind be viewed as a fully operating layer or are there many leaky abstractions?
  • The human body and practical health
    • Digestion and nutrition
      • What makes a balanced diet?
      • Metabolism rates and and people's weights. How would skinny people have fared in hungrier times? (See also The Hungry Brain)
    • Infection and disease
      • how bacteria and viruses spread
      • how the layers of the immune system works
      • how allergies develop and why they're more common now
    • Exercise
      • Why it's beneficial
      • What practices for most benefits?
      • How muscles strengthen and weaken 
    • Answering health questions - the fundamentals to know + search skills to find answers
    • The connection between psychological wellbeing and physical health
    • Modern world - evaluating the risks that new substances (e.g. Teflon, BPA) may pose to human health
    • Teeth - how cavities develop and best practices for preventing them
      • Besides sugar, which foods are most harmful? How long does it take for decaying processes to start occurring? 
      • Can one reduce prevent the mouth from being colonized by harmful bacteria?
      • Does flossing work in practice? What are alternatives
      • What other treatments exist (e.g. Silver diammine fluoride)
    • Sleep - what happens in the body during sleep, best practices for sleep
  • Big picture topics