Showing posts with label Deep Learning. Show all posts
Showing posts with label Deep Learning. Show all posts

Sunday, March 10, 2019

GPT-2: what does it mean?



This got a lot of attention.
"System Prompt (human-written)

In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English.

Model Completion (machine-written, 10 tries)

The scientist named the population, after their distinctive horn, Ovid’s Unicorn. These four-horned, silver-white unicorns were previously unknown to science.

Now, after almost two centuries, the mystery of what sparked this odd phenomenon is finally solved.

Dr. Jorge Pérez, an evolutionary biologist from the University of La Paz, and several companions, were exploring the Andes Mountains when they found a small valley, with no other animals or humans. Pérez noticed that the valley had what appeared to be a natural fountain, surrounded by two peaks of rock and silver snow.

Pérez and the others then ventured further into the valley. “By the time we reached the top of one peak, the water looked blue, with some crystals on top,” said Pérez.

Pérez and his friends were astonished to see the unicorn herd. These creatures could be seen from the air without having to move too much to see them – they were so close they could touch their horns.

While examining these bizarre creatures the scientists discovered that the creatures also spoke some fairly regular English. Pérez stated, “We can see, for example, that they have a common ‘language,’ something like a dialect or dialectic.”

Dr. Pérez believes that the unicorns may have originated in Argentina, where the animals were believed to be descendants of a lost race of people who lived there before the arrival of humans in those parts of South America.

While their origins are still unclear, some believe that perhaps the creatures were created when a human and a unicorn met each other in a time before human civilization. According to Pérez, “In South America, such incidents seem to be quite common.”

However, Pérez also pointed out that it is likely that the only way of knowing for sure if unicorns are indeed the descendants of a lost alien race is through DNA. “But they seem to be able to communicate in English quite well, which I believe is a sign of evolution, or at least a change in social organization,” said the scientist."
---

Here's what Open AI, the developers of GPT-2, had to say.
"Our model, called GPT-2 (a successor to GPT), was trained simply to predict the next word in 40GB of Internet text. Due to our concerns about malicious applications of the technology, we are not releasing the trained model. As an experiment in responsible disclosure, we are instead releasing a much smaller model for researchers to experiment with, as well as a technical paper.

GPT-2 is a large transformer-based language model with 1.5 billion parameters, trained on a dataset of 8 million web pages. GPT-2 is trained with a simple objective: predict the next word, given all of the previous words within some text. The diversity of the dataset causes this simple goal to contain naturally occurring demonstrations of many tasks across diverse domains. GPT-2 is a direct scale-up of GPT, with more than 10X the parameters and trained on more than 10X the amount of data.

GPT-2 displays a broad set of capabilities, including the ability to generate conditional synthetic text samples of unprecedented quality, where we prime the model with an input and have it generate a lengthy continuation. In addition, GPT-2 outperforms other language models trained on specific domains (like Wikipedia, news, or books) without needing to use these domain-specific training datasets. On language tasks like question answering, reading comprehension, summarization, and translation, GPT-2 begins to learn these tasks from the raw text, using no task-specific training data. While scores on these downstream tasks are far from state-of-the-art, they suggest that the tasks can benefit from unsupervised techniques, given sufficient (unlabeled) data and compute.

Samples

GPT-2 generates synthetic text samples in response to the model being primed with an arbitrary input. The model is chameleon-like — it adapts to the style and content of the conditioning text. This allows the user to generate realistic and coherent continuations about a topic of their choosing, as seen by the following select samples.

[Then there follows the 'Unicorn' text you already saw above]."
---

Scott Alexander got pretty excited about GPT-2's capabilities and wrote a series of posts arguing it was a significant step towards AGI (artificial general intelligence). This was based on his thesis that all of intelligence is predictive modelling and therefore in some sense AGI is a linear extrapolation of what GPT-2 is doing.

---

I'm not that excited about the fake news aspects. Deep-learning is tearing the ground up in the field of stochastic prediction. We're just at the foothills - to mix the metaphors. It's all quite unstoppable.

As long as we live in a human-dominated society, what you read from GPT-2 and its brethren will be what some human wants you to read. So the semantic content of the message will be parasitic on whatever the human wanted to communicate - lies or truth or bias or opinion or whatever.

So the AI is a prosthesis. Get over it.

---

I'm much more interested in the architectural questions.

The most perceptive assessments of deep-learning architectures address the critique that engineered systems adopt a tabula rasa methodology. The systems have zero prior knowledge, and merely induce parsimoniously from the offered data sets.

To which there are two good responses.

Firstly, there are many different artificial neural net topologies. For example, convolutional neural nets have a structure similar to that of the biological visual cortex and are used (amongst other things) for image processing, for example, scene and facial recognition. The pattern of local connectivity in the early processing stages of these nets implements the convolution operations which are known to be relevant to feature extraction.

Evolution didn't know that in advance. The earliest biological neural nets for vision which had been selected for ended up with this near-neighbour property genetically-coded, before they had registered even a single image. The same is true for artificial systems.

Brain anatomy does not present as a uniform pudding bowl of grey porridge. The brain has discrete modules with complicated names. Why? I guess because they do different kinds of processing and are therefore topologically optimised for different kinds of operation. We don't know yet.

In AI we have the luxury of flexibility. With a new kind of problem-domain we can experiment with all kinds of different topology, both before training and also by observing weight assignment after training. Deep-learning is going to evolve towards a brain-like situation where the data-processing invariants for all kinds of distinct tasks (such as effector-control, taste-analysis, 'emotion'-processing and consciousness-like functions) are engineered each with their optimised neural net architecture - once we discover what that is.

---

To produce text which works as an intervention in human affairs you have to be a social actor and have interests.

GPT-2 is not in any important sense an architectural precursor of such a scarily-political AI.

Tuesday, January 09, 2018

Autism & IQ, Deep Learning, Quantum Computing

Three papers (PDF) for you today.

---

1. Autism As a Disorder of High Intelligence - Bernard J. Crespi

Alterations of function in the autistic brain

Crespi's paper attempts to synthesise what is know phenotypically about mental pathologies such as autism with the genetics of intelligence. His thesis is:
"... alleles for autism overlap broadly with alleles for high intelligence, which appears paradoxical given that autism is characterized, overall, by below-average IQ.

This paradox can be resolved under the hypothesis that autism etiology commonly involves enhanced, but imbalanced, components of intelligence. This hypothesis is supported by convergent evidence showing that autism and high IQ share a diverse set of convergent correlates, including large brain size, fast brain growth, increased sensory and visual-spatial abilities, enhanced synaptic functions, increased attentional focus, high socioeconomic status,more deliberative decision-making, professional and occupational interests in engineering and physical sciences, and high levels of positive assortative mating."
and
".. autism represents most broadly a disorder of high intelligence (and low imagination), and schizophrenia a disorder of high imagination (and low intelligence) .. ."
I think his argument works best at the Asperger-end of the spectrum, where brain architecture imbalances have not yet led to major social dysfunction.

---

2. Deep Learning: A Critical Appraisal by Gary Marcus



Gary Marcus says "I present ten concerns for deep learning, and suggest that deep learning must be supplemented by other techniques if we are to reach artificial general intelligence."

He begins by observing starkly that "Deep learning, as it is primarily used, is essentially a statistical technique for classifying patterns, based on sample data, using neural networks with multiple layers."

Deep learning typically "knows" no more than can be inferred from regularities in the offered datasets (images, sounds, texts). With such limited data it's generally going to be impossible to infer background theories such as folk physics and folk psychology, let alone the physical and social properties of objects, people and behaviours which condition our everyday lives.

He then examines in detail just how consequentially-brittle deep learning systems are at generalising correctly outside of their training sets. This does not augur well for applications in open domains (such as self-driving cars, Internet censorship and the construction of competent social companions such as chatbots).

I completely agree with this paper, together with its conclusions that some serious new thinking is desperately required.

[Via "The Wild Week in AI"].

---

3. "Quantum Computing in the NISQ era and beyond" by John Preskill

From the abstract.
"Noisy Intermediate-Scale Quantum (NISQ) technology will be available in the near
future. Quantum computers with 50-100 qubits may be able to perform tasks which
surpass the capabilities of today’s classical digital computers, but noise in quantum
gates will limit the size of quantum circuits that can be executed reliably."
This is a useful review of the field of quantum computing, aimed at (technically-minded) venture capitalists. It's accessible and describes what quantum computing is, the various ways it can be implemented and what a quantum computer can - and cannot - do.

Almost the ideal introduction.

[Via Scott Aaronson].

Friday, April 28, 2017

"The £20 BILLION race to create an AI sex doll"

From the Daily Mail Online today.


"The 'sex tech' market is worth an estimated $30.6bn - and across the globe, firms are racing to create a radical new type of robot they say could change sex forever.

"From AI personalities capable of holding a conversation to models with a functioning G-spot, firms are hoping consumers will pay up to $15,000 for a sex doll that never says no.

"Among the most impressive is RealDoll's Harmony - an artificial intelligence based sex bot that can hold conversations, remember what she's told and even has a customizable personality. ..."
The Guardian also has the story, their extensive article suggesting that (unfortunately?) hype is still running way ahead of reality.

---

I was always puzzled (quick disclaimer: when I thought about the subject at all) as to how the sexbot's responses would be programmed.

I imagined over-excited yet poorly-paid programmers toiling in robot control language, trialling this limb movement in response to that input.

Silly me: still trapped in that old GOFAI paradigm.

They'll simple enroll thousands of couples, wire them up to a dense mesh of sound and motion sensors .. and set them to go.

With so much fine-grained big data at their disposal, they'll unleash a DeepMind-style artificial neural net .. and just learn optimised responses.*

It'll be 'Go' all over again.

---

* I seriously would not want to be on the test team ... .

Tuesday, April 18, 2017

On the granting of moral rights

If you gratuitously kick a cat, you are guilty of sadism; if you smash a laptop you are guilty of vandalism. There is a moral distinction.

Sometimes animals and people are not considered moral agents. It is said that in mediaeval times there was no legal or moral objection to a knight killing a peasant. It was, however, seen as vandalism towards a factor of production.

Slaves were famously 'tools with voices'.

No-one has yet met with any AI system and taken a moral stance towards it; no-one has yet worried about turning the power off. As far out as we can see, new and exciting 'deep learning' AI systems are just better tools.

In theory their very power should boost productivity but who gets the benefit? We over-produce generic graduates and consequently don't pay them much. A talented AI engineer can expect a six figure income pretty soon into their career. But what they know is technical and complicated: STEM remains a minority pastime.

---

Overproduction of wannabe elites is such a poor idea.



We really do need to find them something worthwhile to do.

Monday, December 12, 2016

Thoughts on that "Deep Learning" textbook


"Machine learning is essentially a form of applied statistics with increased emphasis on the use of computers to statistically estimate complicated functions and a decreased emphasis on proving confidence intervals around these functions; we therefore present the two central approaches to statistics: frequentist estimators and Bayesian inference.

"Most machine learning algorithms can be divided into the categories of supervised learning and unsupervised learning; we describe these categories and give some examples of simple learning algorithms from each category.

"Most deep learning algorithms are based on an optimization algorithm called stochastic gradient descent."
From "Deep Learning", Chapter 4, page 98.

I've now skim-read the PDF version. It's plainly an engineering text - plenty of detail for practitioners. As a consequence, it's hard to see the wood for the trees. Machine Learning systems are currently super-sophisticated classifiers under some carefully chosen optimisation criteria (least squares estimation is one of the simplest).

However, many problems can be put into this form.

I'm still thinking that the only way we're going to understand higher brain functions is by building models in an experimental way. The philosophers in their armchairs have conspicuously failed to deliver on 'the hard problem'.

The key to this is the ability to build and connect enough artificial neuron-type components (Intel has a new chip). A new slogan is called for: 'In the neural capacity lies the consciousness'.

That, and some clever architecture and design ideas - we seem to have no shortage of smart people flocking into this new discipline.

Schrödinger's advice to his physics doctoral candidates: 'Learn more maths!'.

---

More: "The major advancements in Deep Learning in 2016" via here.

Wednesday, November 30, 2016

The secondary market in Replikas

From section 1.2.2 of the new book, "Deep Learning",
"As of 2016, a rough rule of thumb is that a supervised deep learning algorithm will generally achieve acceptable performance with around 5,000 labeled examples per category, and will match or exceed human performance when trained with a dataset containing at least 10 million labeled examples."
The personal mind-clone of yourself that Replika offers (eventually!) is trained at c. 40 text messages per day. This supervised learning hits the 5,000 target at 5,000/40 = 125 days, approximately four months.

Replika will soon have a vast collection of human-conversation chatbots, albeit biased towards geeky types.

I wonder at Replika's business model .. who owns the rights to my replika?*

If it's the company, I see a good business copying these chatbots and selling packaged versions - perhaps in collaboration with a purveyor of modern-day animatronic mannequins - to those seeking companionship.

I'm trying to imagine my aged mother, before her death, parking an Alfie Boe mannequin on the settee, powered by my very own Replika, 'Bede'.

Alfie Boe

I'd say the picture even looks like me .. .

---

* From the website:
"Intellectual Property

The Service and its original content, features and functionality are and will remain the exclusive property of Luka, Inc. and its licensors."

Monday, November 28, 2016

New 'Deep Learning' book

Amazon link

At 800 pages this will become the standard introduction to machine learning. It's expensive - £59.95 on Amazon - but you can read it for free (in a cumbersome way) as web pages here.

Update: MIT Press were shortsighted banning a free PDF. There are copies all over the net (try github). Here's a link, although the file is large (370 MB for an 800 page book).

---

Table of contents.
Website
Acknowledgments
Notation

1 Introduction
1.1 Who Should Read This Book
1.2 Historical Trends in Deep Learning

Part I Applied Math and Machine Learning Basics

2  Linear Algebra
2.1 Scalars, Vectors, Matrices and Tensors
2.2 Multiplying Matrices and Vectors
2.3 Identity and Inverse Matrices
2.4 Linear Dependence and Span
2.5 Norms
2.6 Special Kinds of Matrices and Vectors
2.7 Eigendecomposition
2.8 Singular Value Decomposition
2.9 The Moore-Penrose Pseudoinverse
2.10 The Trace Operator
2.11 The Determinant
2.12 Example: Principal Components Analysis

3 Probability and Information Theory
3.1 Why Probability?
3.2 Random Variables
3.3 Probability Distributions
3.4 Marginal Probability
3.5 Conditional Probability
3.6 The Chain Rule of Conditional Probabilities
3.7 Independence and Conditional Independence
3.8 Expectation, Variance and Covariance
3.9 Common Probability Distributions
3.10 Useful Properties of Common Functions
3.11 Bayes’ Rule
3.12 Technical Details of Continuous Variables
3.13 Information Theory
3.14 Structured Probabilistic Models

4 Numerical Computation
4.1 Overflow and Underflow
4.2 Poor Conditioning
4.3 Gradient-Based Optimization
4.4 Constrained Optimization
4.5 Example: Linear Least Squares

5 Machine Learning Basics
5.1 Learning Algorithms
5.2 Capacity, Overfitting and Underfitting
5.3 Hyperparameters and Validation Sets
5.4 Estimators, Bias and Variance
5.5 Maximum Likelihood Estimation
5.6 Bayesian Statistics
5.7 Supervised Learning Algorithms
5.8 Unsupervised Learning Algorithms
5.9 Stochastic Gradient Descent
5.10 Building a Machine Learning Algorithm
5.11 Challenges Motivating Deep Learning

Part II Deep Networks: Modern Practices

6 Deep Feedforward Networks
6.1 Example: Learning XOR
6.2 Gradient-Based Learning
6.3 Hidden Units
6.4 Architecture Design
6.5 Back-Propagation and Other Differentiation Algorithms
6.6 Historical Notes

7 Regularization for Deep Learning
7.1 Parameter Norm Penalties
7.2 Norm Penalties as Constrained Optimization
7.3 Regularization and Under-Constrained Problems
7.4 Dataset Augmentation
7.5 Noise Robustness
7.6 Semi-Supervised Learning
7.7 Multi-Task Learning
7.8 Early Stopping
7.9 Parameter Tying and Parameter Sharing
7.10 Sparse Representations
7.11 Bagging and Other Ensemble Methods
7.12 Dropout
7.13 Adversarial Training
7.14 Tangent Distance, Tangent Prop, and Manifold Tangent Classifier

8 Optimization for Training Deep Models
8.1 How Learning Differs from Pure Optimization
8.2 Challenges in Neural Network Optimization
8.3 Basic Algorithms
8.4 Parameter Initialization Strategies
8.5 Algorithms with Adaptive Learning Rates
8.6 Approximate Second-Order Methods
8.7 Optimization Strategies and Meta-Algorithms

9 Convolutional Networks
9.1 The Convolution Operation
9.2 Motivation
9.3 Pooling
9.4 Convolution and Pooling as an Infinitely Strong Prior
9.5 Variants of the Basic Convolution Function
9.6 Structured Outputs
9.7 Data Types
9.8 Efficient Convolution Algorithms
9.9 Random or Unsupervised Features
9.10 The Neuroscientific Basis for Convolutional Networks
9.11 Convolutional Networks and the History of Deep Learning

10 Sequence Modeling: Recurrent and Recursive Nets
10.1 Unfolding Computational Graphs
10.2 Recurrent Neural Networks
10.3 Bidirectional RNNs
10.4 Encoder-Decoder Sequence-to-Sequence Architectures
10.5 Deep Recurrent Networks
10.6 Recursive Neural Networks
10.7 The Challenge of Long-Term Dependencies
10.8 Echo State Networks
10.9 Leaky Units and Other Strategies for Multiple Time Scales
10.10 The Long Short-Term Memory and Other Gated RNNs
10.11 Optimization for Long-Term Dependencies
10.12 Explicit Memory

11 Practical Methodology
11.1 Performance Metrics
11.2 Default Baseline Models
11.3 Determining Whether to Gather More Data
11.4 Selecting Hyperparameters
11.5 Debugging Strategies
11.6 Example: Multi-Digit Number Recognition

12 Applications
12.1 Large-Scale Deep Learning
12.2 Computer Vision
12.3 Speech Recognition
12.4 Natural Language Processing
12.5 Other Applications

Part III Deep Learning Research

13 Linear Factor Models
13.1 Probabilistic PCA and Factor Analysis
13.2 Independent Component Analysis (ICA)
13.3 Slow Feature Analysis
13.4 Sparse Coding
13.5 Manifold Interpretation of  PCA

14 Autoencoders
14.1 Undercomplete Autoencoders
14.2 Regularized Autoencoders
14.3 Representational Power, Layer Size and Depth
14.4 Stochastic Encoders and Decoders
14.5 Denoising Autoencoders
14.6 Learning Manifolds with Autoencoders
14.7 Contractive Autoencoders
14.8 Predictive Sparse Decomposition
14.9 Applications of Autoencoders

15 Representation Learning
15.1 Greedy Layer-Wise Unsupervised Pre-training
15.2 Transfer Learning and Domain Adaptation
15.3 Semi-Supervised Disentangling of Causal Factors
15.4 Distributed Representation
15.5 Exponential Gains from Depth
15.6 Providing Clues to Discover Underlying Causes

16 Structured Probabilistic Models for Deep Learning
16.1 The Challenge of Unstructured Modeling
16.2 Using Graphs to Describe Model Structure
16.3 Sampling from Graphical Models
16.4 Advantages of Structured Modeling
16.5 Learning about Dependencies
16.6 Inference and Approximate Inference
16.7 The Deep Learning Approach to Structured Probabilistic Models

17 Monte Carlo Methods
17.1 Sampling and Monte Carlo Methods
17.2 Importance Sampling
17.3 Markov Chain Monte Carlo Methods
17.4 Gibbs Sampling
17.5 The Challenge of Mixing between Separated Modes

18 Confronting the Partition Function
18.1 The Log-Likelihood Gradient
18.2 Stochastic Maximum Likelihood and Contrastive Divergence
18.3 Pseudolikelihood
18.4 Score Matching and Ratio Matching
18.5 Denoising Score Matching
18.6 Noise-Contrastive Estimation
18.7 Estimating the Partition Function

19 Approximate Inference
19.1 Inference as Optimization
19.2 Expectation Maximization
19.3 MAP Inference and Sparse Coding
19.4 Variational Inference and Learning
19.5 Learned Approximate Inference

20 Deep Generative Models
20.1 Boltzmann Machines
20.2 Restricted Boltzmann Machines
20.3 Deep Belief Networks
20.4 Deep Boltzmann Machines
20.5 Boltzmann Machines for Real-Valued Data
20.6 Convolutional Boltzmann Machines
20.7 Boltzmann Machines for Structured or Sequential Outputs
20.8 Other Boltzmann Machines
20.9 Back-Propagation through Random Operations
20.10 Directed Generative Nets
20.11 Drawing Samples from Autoencoders
20.12 Generative Stochastic Networks
20.13 Other Generation Schemes
20.14 Evaluating Generative Models
20.15 Conclusion

---

On Amazon.com S. Matthews wrote this insightful review:
"This is, to invoke a technical reviewer cliché, a 'valuable' book. Read it and you will have a detailed and sophisticated practical understanding of the state of the art in neural networks technology. Interestingly, I also suspect it will remain current for a long time, because reading it I came to more and more of an impression that neural network technology (at least in the current iteration) is plateauing.

"Why? Because this book also makes very clear - is completely honest - that neural networks are a 'folk' technology (though they do not use those words): Neural networks work (in fact they work unbelievably well - at least, as Geoffrey Hinton himself has remarked, given unbelievably powerful computers), but the underlying theory is very limited and there is no reason to think that it will become less limited, and the lack of a theory means that there is no convincing 'gradient', to use an appropriate metaphor, for future development.

"A constant theme here is that 'this works better than that' for practical reasons not for underlying theoretical reasons. Neural networks are engineering, they are not applied mathematics, and this is very much, and very effectively, an engineer's book."

Friday, November 25, 2016

"My chat bot found my wallet" - Adrian Zumbrunnen

When you turn your website into a chatbot ...



"It was a Saturday afternoon. I met up with a friend to enjoy the occasional good weather by the lake. It was a day void of serious topics or stress. Life is good, I thought to myself.

I headed home after a few drinks to prepare for an upcoming trip. The smile on my face soon vanished when I realized that my pockets felt awfully empty. I braced myself. Three seconds later, I panicked. Where was my wallet?!

My credit card, my ID and personal stuff was in there. I felt like ****.

After calling my card issuer to block my credit card, I waited for the confirmation email to breath some sigh of relief. But to my surprise, there was a much more delightful message waiting for me right there… It was an email from my conversational website:

Title: Chat bot message
Content: I found your wallet by the lake.

Wow! I only lost my wallet 30 minutes earlier and I had already gotten an email. That’s technology working its magic right there!

I answered as fast as I could. The other person sent me his number and we met later that same day. As he was kindly handing me back my wallet, I asked:

“Thanks so much! By the way, I’m just wondering… How did you get in touch with me?”

He looked at me slightly confused and says…

“What do you mean… We had a chat, no?”

That’s when it hit me. This guy thought he was having a real conversation with me on my website."
It's an interesting story, but if you access Adrian's site you will find it hard to imagine you're talking to him (picture above). (Try it).

Adrian provides you with little 'suggestion' buttons to avoid uncontrolled natural language input. This is current best practice, but it makes the experience not dissimilar to filling in a form.

---

Last night I tried the new Thomson Holidays chatbot (powered by IBM's Watson). It fell apart on the second dialogue input. Admittedly it's in beta. (Try it).

Feigenbaum's old AI adage, 'in the knowledge lies the power', holds good for chatbots. The system needs to know an awful lot of dialogue flows to create the illusion of conversation. This makes building chatbots labour-intensive (for machine-learning, you need big pre-recorded conversation datasets).

I have neither, which has demotivated me from experiments with Pandorabots. That, and its simple-minded stimulus-response architecture.

Checked on Replika a couple of days ago which I have signed up to. The iPhone version will be out soon but the Android app is pushed back to 2017. The training method is Q&A via SMS: people are sending 40-50 texts per day to train their replikas. Like I said: labour intensive.

---

You and I know that conversation isn't simply statistically-correlated sequences of 'he says', 'she says'. It's about something. Until the meaning of conversations (data structures representing external environment and internal attitudes) is part of the architecture, chatbot conversations will continue to fall off the rails without any warning.

You can see why capturing knowledge of the real world (and of the human psychological world) is difficult for a paradigm which mostly throws ever more ingenious massively-parallel weight-learning at truly enormous datasets.*

---

* Huge parallel with self-driving cars. Humans drive .. which obscures the fact that driving is many distinct activities, not just one. A relatively closed system like motorway travel in good weather conditions sharply contrasts with the horribly open system of urban driving with complex traffic patterns and uncontrolled pedestrians in bad weather.

Wednesday, June 15, 2016

This & that

After putting the kettle on, my second most important task first thing is to feed the cat.

This morning I carefully diced his cheddar cheese into bite-sized chunks, scooped beef-pâté from a can and added a little salmon from a packet on to his plate.

I walked into the hall, bent my knees and leaned forward to place his plate in the floor. As I did so, I experienced a sudden arc of pain horizontally across my lower back. As I sat immobilised on the stairs, my first thought was: "No gym for me today."

I'm moving around cautiously at the moment and not sitting too much - this is not the first time I've had a lower back strain - and I expect several days of recovery time. Next time I'm at the gym, I hereby remind myself to ask about specific exercises to strengthen the lower back.

The cat enjoyed his breakfast.

---

Later this morning I went for a therapeutic walk to town - Clare wanted some straw for the strawberries.

Clare distributes the straw


She carried the bale back.

---

I've just finished the interesting (for a textbook) "Behavioural Genetics" by Robert Plomin et al.



I salute the bravery and sheer persistence of the pioneers (including the authors) who patiently worked over their professional lives to work out the heritability of almost everything. The social sciences establishment had (and has) little but contempt for their efforts.

Since almost all behavioural traits are heritable in the range 0.3 - 0.7, (even working out at the gym) such agenda-based prejudice against any role at all for genetics makes you want to weep.

The robust results reported were teased-out mostly from twin and adoption studies. The sections with least detail are those which try to identify specific alleles underpinning the measured heritability. At time of publishing (2013) the GWAS revolution had barely got started and here in 2016 it's still in the early phases.

If a new edition is published c. 2020, I imagine genotype chapter and verse will be available for most behavioural traits.

Blank-slate elite culture (media, TV, politicians) will continue to ignore these results, while mendaciously claiming that environment is everything.

---

I was in two minds about "The Master Algorithm" (Pedro Domingos) as the reviews were mixed. And then Bill Gates gave the book his imprimatur and I read the reviews more closely. It's not that the book is overly non-technical (which was my fear) - more that it's uneven and perhaps a little badly written.




I can cope with that. As the only popular science book about AI deep learning out there, I'm keen to start reading it. More later.

Thursday, January 21, 2016

The idiot gatekeeper and why we can't do better



I had to call the Inland Revenue (HMRC) this morning. After the automated intro you connect to a speech-recognition system which asks you why you are calling:
"Tell me in a few words what you are calling about."
Naturally it's both useless and annoying. It recognises speech at the level of individual keywords and can't handle any conceptual complexity. Many of the pre-programmed responses tell you to check a website or call some other number - at which point it hangs up. It's very unwilling to let you talk to a human being.

After three calls and being disconnected each time, I found the right series of lies to allow this idiot-gatekeeper to connect me to a human being. At which point I was able to transact some complications in the management of the tax on my late mother's estate.

Why is it so hard?

When we speak a meaningful sentence, it's not hard to create a useful knowledge representation of what was said - AI researchers have known how to parse sentences and create meaning-structures such as semantic nets for ages.  'Understanding' means doing something appropriate with the resulting semantic net - either use logical connections to derive consequences, or load associated semantic nets for things like problem reframing or context management.

Example:
"How much tax do I owe?"
could be translated into this semantic net:
[Parameter(caller)] - owes - [Variable(tax-amount)]
along with a processing script which says something like:
1. Identify 'caller' and add this information to the query semantic net.
2. Add in missing contextual information, eg an implicit 'for the previous tax year'.
3. Compute the variable 'tax-amount'.
4. Compute a semantic net like this:

   [Parameter(caller)] - owes - [Parameter(tax)] - for - [Parameter(prev-tax-year)]

5. Construct an English language version of the above and play it to the caller.
Developing the 'scripts', which encompass a bunch of stuff like inference, abduction, induction, conversation rules, pragmatics, ..., is harder than the knowledge representation and database loading.

Still, like I said, question-answering systems have been able to do something like this in toy domains for decades, so why can't the HMRC get it right?

If you listened to transcripts of what people actually say when they call the tax authorities you would wonder how trained people ever get it right: the confusions, mis-steps, misunderstandings; the clarificatory questions needed to get an intelligible query out of the caller, the open-endedness of the topics which prompted the call ... .

After knowledge engineers spent thousands of hours trying to hand-craft ever-increasing databases of semantic nets (or their equivalents) capturing all the everyday world issues underlying lay-people's queries, it eventually became clear that the task never ends and that it's all way too expensive.

---

In case you think that the idiot-savant 'new AI' of neural net 'deep learning' is going to:

  • solve the world's problems 
  • steer the Google car
  • answer all our tax queries 

I refer you to the current MIT Technology Review, where we see the superficial strengths and deep structural weaknesses of contemporary learning and statistical methods as applied to human speech ("How an AI Algorithm Learned to Write Political Speeches").
"Valentin Kassarnig at the University of Massachusetts, Amherst, .. has created an artificial intelligence machine that has learned how to write political speeches that are remarkably similar to real speeches.

"The approach is straightforward in principle. Kassarnig used a database of almost 4,000 political speech segments from 53 U.S. Congressional floor debates to train a machine-learning algorithm to produce speeches of its own.

"These speeches consist of over 50,000 sentences each containing 23 words on average. Kassarnig also categorized the speeches by political party, whether Democrat or Republican, and by whether it was in favor or against a given topic.

"Of course, the devil is in the details of how to analyze this database. Having tried a number of techniques, Kassarnig settled on an approach based on n-grams, sequences of “n” words or phrases. He first analyzed the text using a parts-of-speech approach that tags each word or phrase with its grammatical role (whether a noun, verb, adjective, and so on).

"He then looked at 6-grams and the probability of a word or phrase appearing given the five that appear before it. “That allows us to determine very quickly all words which can occur after the previous five ones and how likely each of them is,” he says.

"The process of generating speeches automatically follows from this. Kassarnig begins by telling the algorithm what type of speech it is supposed to write—whether for Democrats or Republicans. The algorithm then explore the 6-gram database for that category to find the entire set of 5-grams that have been used to start one of these speeches.

"The algorithm then chooses one of these 5-grams at random to start its speech. It then chooses the next word from all those that can follow this 5-gram. “Then the system starts to predict word after word until it predicts the end of the speech,” he says."
Here's a sample (as boring and content-free as you would expect).
Mr. Speaker, for years, honest but unfortunate consumers have had the ability to plead their case to come under bankruptcy protection and have their reasonable and valid debts discharged. The way the system is supposed to work, the bankruptcy court evaluates various factors including income, assets and debt to determine what debts can be paid and how consumers can get back on their feet. Stand up for growth and opportunity. Pass this legislation.
Only good for filibusters, I would think.

Please don't anyone tell the HMRC.

Tuesday, December 22, 2015

The Christmas Badger and other stories

Remember all those badgers we saw in our garden earlier this year? I really thought the badgers were gone, driven out by culling and teams of tooled-up Hedgehogs looking for payback.

And then, two days ago, this.




---

Amidst all the hype about the second coming of Deep Learning AI propelled by Google, Facebook, Baidu, IBM and Microsoft, Randall Munroe at xkcd nails it.



You can point your multi-tiered artificial neural net at vast datasets too large to imagine .. your system can induce optimal concepts to its heart's content on zillions of parallel graphics chips .. and still it will have no common sense.

Please, people, do not trust your life to our new AI overlords!

---

We have Alex staying with us. Last night we ran the BBC Proms programme (stashed way too long on our Sky Box hard drive) featuring Sir András Schiff playing the Goldberg Variations. Seventy five minutes of virtuoso technique and total commitment.

Alex complained of 'lack of musicality' at intervals, to the alleged advantage of Glenn Gould.



Today we reverted to type at M&S Frome where we stocked up on Christmas goodies.

Alex and Clare: the profiterole mountain is yet to come ..
Not long now!

Monday, November 16, 2015

"How to Create a Mind" - Ray Kurzweil

As an active AI researcher in the 1980s I knew about Ray Kurzweil. He was into the nuts and bolts of speech-recognition systems with a sideline in AI-fantasising ('The Singularity'). I was much more interested in the formal theory of intelligent systems (modal logics with automata-theoretic models).

As I mentioned a few posts ago, classical AI is out and Deep Learning is the new thing. The world has rolled around to Kurzweil's front door and he has a plum new job with Google. Belatedly time to learn from the master?



Initially I was a fan of "How to Create a Mind: The Secret of Human Thought Revealed" (which purports to be the blueprint for Kurzweil's work at Google). Early chapters give a good account of important brain structures (neocortex, hypothalamus, amygdala, etc); it's rather Reader's Digest, but written from a functionalist and computational point of view. He also gives a good elementary account of sparse coding, hidden markov models and genetic algorithms applied to the architecture of a number of real-world successful systems (mostly his own) .. but even, to an extent, that of IBM's Watson.

And then it all went so horribly wrong.

First off there's the vanity. Name-dropping, lot's of it, all with faux-humility. There's Famous Professor X (private communication), Famous Professor Y (who invited me in to discuss his work); there's damning with faint praise (Z's system isn't built the way I would have done it, it required hundreds of people working intensely for many years, with only modest results - but I give due credit for what it can do); there's a pervading essence of insecure self-regard, self-centredness and a need to control others.

All my instincts tell me this guy is a smart, huckstering salesman - a less-intense Steve Jobs.

Google, what were you thinking of?

The latter half of the book meanders into oversimplified philosophy (and there's an oxymoron for you). There's Kurzweil on consciousness, free-will and qualia. It's not so much that what he says is wrong - it's just unoriginal, unperceptive, bland, boring and padded.

Let me leave you with Professor McGinn, from Wikipedia:
"In a critical review of the book, philosopher Colin McGinn refers to "the hype so blatantly brandished in its title" and asks: "He is clearly a man of many parts—but is ultimate theoretician of the mind one of them?" McGinn calls Kurzweil's claim that pattern recognition is the key to mental phenomena "obviously false" and concludes that the book is "interesting in places, fairly readable, moderately informative, but wildly overstated".
I would add that despite the author's irritating self-presumption of omniscience, the book is littered with mistakes and misunderstandings (his grasp of physics is particularly wobbly).

Friday, November 13, 2015

Priddy Mineries; SJWs and SF; AI deep learning

Clare has had a vision these last days of a walk in the autumnal woods surrounded by the glowing colours of the falling leaves. In the last of the year's sun, we would stroll in a kaleidoscope of natural beauty.

And then there is the inevitable collision with the English climate.

In a short weather window, after a stroll in Stockhill Wood

A rain-soaked Priddy Mineries
I've been quite impressed by Ian McDonald's work so have just ordered 'Luna: New Moon' ; apparently a sequel is scheduled for publication next year and yet another volume in 2017. I particularly enjoyed his 'Brasyl', set in an alternate reality of the Latin-American country:
"A story that begins in the favelas, the slums of Rio, and quickly expands to take in drugs, corruption, and a frightening new technology that allows access to all the multiple worlds that have slipped into existence in other planes every time we make a decision."
Good review here.

I remember McDonald being a target of 'social justice warriors' for his temerity in placing his densely-imagined novels in developing countries (India is another favourite of his). This from Abigail Nussbaum's review of his earlier 'River of Gods'.
"It's a positive, vibrant, and persuasive description, but also one that gives rise to a feeling of unease when one recalls that McDonald is, after all, a white man from Belfast. What right does he have to write about India, much less to pretend to have captured its essence, much much less to imagine its future? When Nic Clarke of Eve's Alexandria reviewed River of Gods, a commenter disdainfully replied that the novel sounded to her like yet another cliché-ridden attempt by a Western writer to fetishize a nation that has become synonymous with exoticism.

"This was not long after the genre blogosphere became embroiled in what's become known as The Great Cultural Appropriation Debate of Doom, an offshoot of a WisCon panel discussing the depiction of cultures by authors foreign to them, and specifically non-white cultures by white authors, and the combination of these two discussions got me seriously reconsidering River of Gods and my, at that point, uncomplicated affection for it.

"McDonald's India feels like a real place, but I have no idea whether he's truly captured the country's spirit and described its driving conflicts with fidelity. He may very well have fictionalized a truth more complicated and nuanced than he was interested in depicting. What's kept me feeling positively towards River of Gods in spite of this realization is the fact that, as I noted above, his India is so strong and independent, so clearly its own entity directing its own fate. River of Gods may be a novel about India told by an outsider, but within the novel India is writing its own story."
I am nonetheless a fan of Abigail's generally insightful reviews. Here is Ian McDonald's background.
"Ian McDonald was born in 1960, in Manchester, to a Scottish father and Irish mother. He moved to Belfast when he was five and has lived there ever since." (Wikipedia).
Deep-Learning has swept all before it in AI, with Facebook, Google and Microsoft competing to hire the smartest researchers. I watched a good introductory video (below) yesterday (~ 40 minutes) by Andrew Ng, who heads up things at Baidu. Delved a bit into backpropagation which is intricate but comprehensible with a little application - figuring it out has been on my 'to-do' list for years.

Despite all the successes, this hierarchical neural-net approach is still modelling perception (something which apparently occupies 60% of most animals' brains). The higher-level stuff - meaning, comprehension, conversation, intentionality still seems a mystery both in paradigm and performance. Much as I would like an AI personal assistant who 'really understands me' and 'how to fix things in the world', it really isn't going to happen anytime soon (unfortunately).



I remember nostalgically when I used to travel Europe and the world as a technical consultant for Nortel. I had scarcely a care in the world as my rather large employer could be relied upon to sort out problems with transport, hotels, illness or any of the other mischances of travel in foreign cultures. If you're rich, you can buy a concierge service which provides a similar level of wraparound care. It will take Google or similar to democratise this for the masses - once they get the AI sorted out.

Like I said, don't hold your breath.

Thursday, September 17, 2015

Of Barbies and Chess Machines


From the MIT Technology Review.
"It’s been almost 20 years since IBM’s Deep Blue supercomputer beat the reigning world chess champion, Gary Kasparov, for the first time under standard tournament rules.  Since then, chess-playing computers have become significantly stronger, leaving the best humans little chance even against a modern chess engine running on a smartphone.

But while computers have become faster, the way chess engines work has not changed. Their power relies on brute force, the process of searching through all possible future moves to find the best next one.

Of course, no human can match that or come anywhere close. While Deep Blue was searching some 200 million positions per second, Kasparov was probably searching no more than five a second. And yet he played at essentially the same level. Clearly, humans have a trick up their sleeve that computers have yet to master."
But Matthew Lai at Imperial College, London has a new approach. His artificial intelligence machine called Giraffe has taught itself to play chess by evaluating positions much more like humans and in an entirely different way to conventional chess engines.
"Straight out of the box, the new machine plays at the same level as the best conventional chess engines, many of which have been fine-tuned over many years. On a human level, it is equivalent to FIDE International Master status, placing it within the top 2.2 percent of tournament chess players.

The technology behind Lai’s new machine is a neural network. This is a way of processing information inspired by the human brain. It consists of several layers of nodes that are connected in a way that change as the system is trained. This training process uses lots of examples to fine-tune the connections so that the network produces a specific output given a certain input, to recognize the presence of face in a picture, for example.

In the last few years, neural networks have become hugely powerful thanks to two advances. The first is a better understanding of how to fine-tune these networks as they learn, thanks in part to much faster computers. The second is the availability of massive annotated datasets to train the networks."

[Read more].
Decades ago an AI researcher made this comparison:
Suppose many years ago you had wanted to understand flight, as in birds and insects. So you played around with a sheet of paper until you fashioned, essentially by clever trial-and-error, a paper aeroplane.

"Look," you said, "I have recreated flight, at least the gliding version. Science has advanced!"
You have not understood flight, you have merely emulated a rather simple aspect of it. To understand flight you need fluid dynamics and a theory of aerofoils. And so it is with the neural networks of deep learning. The simulated neurons, axons and dendrites with their super-high-dimensional weighting-vector-spaces achieve minor miracles in selected domains .. but there is no theory.

It flies, in a gliding version, but we still don't know why.

Classic (that is, symbolic) AI, for me, only ever had two ideas. One was automated inference over formal languages and the other was heuristic search.

The former covers expert systems, knowledge representation, planners, scripts, natural language understanding systems and automated theorem provers.

The latter covers chess-programs (and a hundred other games) and provides the control mechanism for many of the former systems using tree and graph traversal algorithms with clever pruning allied with sophisticated state evaluation functions.

These two ideas conceptualised Intelligence as abstract reasoning in a large space of symbolic options, selecting what was good and useful via a domain-specific evaluation function. It's not a bad theory in certain highly-intellectualised tasks but it falls apart for tacit, common-sense knowledge and everyday competences. The problem is that we're only able to properly formalise microworlds; the real world is just too interconnected, fast-moving and messy.

So I think it's fair to say that we've pretty well reached the limits of applicability of classical AI. As diminishing returns set in, the grown ups: Google, Facebook (even Mattel for God's sake) have moved to deep learning for the real goods, based on those inscrutable neural networks.

Hello Barbie is coming to town in November 2015. An example of what you can do with a 1965 idea (ELIZA) if you throw unbounded cash and people at it, and leverage the latest WiFi, Internet and deep-learning speech understanding technologies.

---

Thanks to Marginal Revolution and Slate Star Codex for some of these links.