machine reading and reasoning with neural program …

157
Machine Reading and Reasoning with Neural Program Interpreters Sebastian Riedel Machine Reading @riedelcastro

Upload: others

Post on 20-Nov-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Machine Reading and Reasoning with Neural Program …

Machine Reading and Reasoning with Neural Program Interpreters

Sebastian Riedel

Machine Reading

@riedelcastro

Page 2: Machine Reading and Reasoning with Neural Program …

Collaborators

!2

Tim RocktäschelMatko Bosnjak

Pontus Stenetorp

(now at Oxford)(UCL)

(UCL)

Johannes Welbl(UCL)

Jason Naradowsky(now Johns Hopkins University)

Marzieh Saeidi Max Bartolo

Guillaume Bouchard(Bloomsbury AI)

(Bloomsbury AI) (Bloomsbury AI)

Page 3: Machine Reading and Reasoning with Neural Program …

!3

The “Classic” NLP Paradigm

Page 4: Machine Reading and Reasoning with Neural Program …

!3

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language]

The “Classic” NLP Paradigm

Page 5: Machine Reading and Reasoning with Neural Program …

!3

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language] [Meaning]

The “Classic” NLP Paradigm

Tesla

PraguemovedTo

Page 6: Machine Reading and Reasoning with Neural Program …

!3

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language] [Meaning]

What city did Tesla move to in 1880?

[Information Need]

The “Classic” NLP Paradigm

Tesla

PraguemovedTo

Page 7: Machine Reading and Reasoning with Neural Program …

!3

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language] [Meaning]

What city did Tesla move to in 1880?

[Information Need]

Prague

The “Classic” NLP Paradigm

Tesla

PraguemovedTo

Page 8: Machine Reading and Reasoning with Neural Program …

!3

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language] [Meaning]

What city did Tesla move to in 1880?

[Information Need]

Prague

The “Classic” NLP Paradigm

Tesla

PraguemovedTo

+reusable cache+interpretable+supports reasoning

Page 9: Machine Reading and Reasoning with Neural Program …

!3

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language] [Meaning]

What city did Tesla move to in 1880?

[Information Need]

Prague

The “Classic” NLP Paradigm

Tesla

PraguemovedTo

+reusable cache+interpretable+supports reasoning

-misses details-error prone

-engineering heavy

Page 10: Machine Reading and Reasoning with Neural Program …

“Should we separate meaning from language?”

!3

Chris Manning @AKBC 2013

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language] [Meaning]

What city did Tesla move to in 1880?

[Information Need]

Prague

Tesla

PraguemovedTo

+reusable cache+interpretable+supports reasoning

-misses details-error prone

-engineering heavy

Page 11: Machine Reading and Reasoning with Neural Program …

“Should we separate meaning from language?”

!3

Chris Manning @AKBC 2013

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language] [Meaning]

What city did Tesla move to in 1880?

[Information Need]

Prague

[Maybe not?]Tesla

PraguemovedTo

+reusable cache+interpretable+supports reasoning

-misses details-error prone

-engineering heavy

Page 12: Machine Reading and Reasoning with Neural Program …

“Should we separate meaning from language?”

!4

Chris Manning @AKBC 2013

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language] [Meaning]

What city did Tesla move to in 1880?

[Information Need]

Prague

[Maybe not?]Tesla

PraguemovedTo

Page 13: Machine Reading and Reasoning with Neural Program …

End-to-End Reading and Comprehension

!5

(Hermann et. al 2015, Seo et al., 2016, Rajpurkar et al., 2016, Weissenborn 2016…)

In January 1880, two of Tesla's uncles put together enough money to help him leave Gospić for Prague where he was to study. Unfortunately, he arrived too late to enrol at Charles-Ferdinand University; he never studied Greek, a required subject; and he was illiterate in Czech, another required subject. Tesla did, however, attend lectures at the universi ty, although, as an auditor, he did not receive grades for the courses.

[Language]

What city did Tesla move to in 1880?

Prague

[Information Need]

Page 14: Machine Reading and Reasoning with Neural Program …

Rules: Entertainment

Offers of entertainment may be accepted or made where they are necessary to develop and maintain outside contacts relevant to work responsibilities… disproportionately lavish. Invitations to expensive or exclusive sporting or cultural events should not be accepted.

3. Invitations from institutions supervised by the Bank or the FCA, or from professional advisers, should not be accepted without prior agreement of an Executive Director or Governor ….

Machine Reading & Comprehension

!6

Would it be appropriate for me to accept court side seating tickets to an NBA event?

Page 15: Machine Reading and Reasoning with Neural Program …

Rules: Entertainment

Offers of entertainment may be accepted or made where they are necessary to develop and maintain outside contacts relevant to work responsibilities… disproportionately lavish. Invitations to expensive or exclusive sporting or cultural events should not be accepted.

3. Invitations from institutions supervised by the Bank or the FCA, or from professional advisers, should not be accepted without prior agreement of an Executive Director or Governor ….

Machine Reading & Comprehension

!6

Rules: Entertainment

Offers of entertainment may be accepted or made where they are necessary to develop and maintain outside contacts relevant to work responsibilities… disproportionately lavish. Invitations to expensive or exclusive sporting or cultural events should not be accepted.

3. Invitations from institutions supervised by the Bank or the FCA, or from professional advisers, should not be accepted without prior agreement of an Executive Director or Governor ….

Would it be appropriate for me to accept court side seating tickets to an NBA event?

Invitations to expensive or exclusive sporting or cultural events should not be accepted

Page 16: Machine Reading and Reasoning with Neural Program …

Archiving Inbox Items

Once an inbox item has been archived it will no longer appear in the list of inbox items returned by cape.client.CapeClient.get_inbox(). To archive an item call cape.client.CapeClient.archive_inbox() with the ID of the inbox item to archive:

from cape.client import CapeClient

cc = CapeClient()cc.login('username', 'password')cc.archive_inbox('4123')

Machine Reading & Comprehension

!7

Which function do I call for storing items in cape?

Page 17: Machine Reading and Reasoning with Neural Program …

Archiving Inbox Items

Once an inbox item has been archived it will no longer appear in the list of inbox items returned by cape.client.CapeClient.get_inbox(). To archive an item call cape.client.CapeClient.archive_inbox() with the ID of the inbox item to archive:

from cape.client import CapeClient

cc = CapeClient()cc.login('username', 'password')cc.archive_inbox('4123')

Archiving Inbox Items

Once an inbox item has been archived it will no longer appear in the list of inbox items returned by cape.client.CapeClient.get_inbox(). To archive an item call cape.client.CapeClient.archive_inbox() with the ID of the inbox item to archive:

from cape.client import CapeClient

cc = CapeClient()cc.login('username', 'password')cc.archive_inbox('4123')

Machine Reading & Comprehension

!7

Which function do I call for storing items in cape?

cape.client.CapeClient.archive_inbox()

Page 18: Machine Reading and Reasoning with Neural Program …

How to read and reason end-to-end?

!8

Page 19: Machine Reading and Reasoning with Neural Program …

Learning to Read and Aggregate

!9

Which medical specialty deals with pituitary ACTH hypersecretion?

Page 20: Machine Reading and Reasoning with Neural Program …

Learning to Read and Aggregate

!9

Which medical specialty deals with pituitary ACTH hypersecretion? Pituitary ACTH hypersecretion ... is a form of

hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

Page 21: Machine Reading and Reasoning with Neural Program …

Learning to Read and Aggregate

!9

Which medical specialty deals with pituitary ACTH hypersecretion? Pituitary ACTH hypersecretion ... is a form of

hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

Page 22: Machine Reading and Reasoning with Neural Program …

Learning to Read and Aggregate

!9

Which medical specialty deals with pituitary ACTH hypersecretion? Pituitary ACTH hypersecretion ... is a form of

hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Page 23: Machine Reading and Reasoning with Neural Program …

Learning to Read and Aggregate

!9

Which medical specialty deals with pituitary ACTH hypersecretion?

Endocrinology

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Page 24: Machine Reading and Reasoning with Neural Program …

Learning to Read and Aggregate

!9

Which medical specialty deals with pituitary ACTH hypersecretion?

Endocrinology

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Part 1

Page 25: Machine Reading and Reasoning with Neural Program …

Learning to Read and Aggregate

!9

Which medical specialty deals with pituitary ACTH hypersecretion?

Endocrinology

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Part 1

NIPS 2017, TACL 2018

Page 26: Machine Reading and Reasoning with Neural Program …

Learning to Read and Calculate

!10

How many pictures were in each of the albums? Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

Page 27: Machine Reading and Reasoning with Neural Program …

Learning to Read and Calculate

!10

How many pictures were in each of the albums?

2

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

Page 28: Machine Reading and Reasoning with Neural Program …

Learning to Read and Calculate

!10

How many pictures were in each of the albums?

2

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

Part 2

Page 29: Machine Reading and Reasoning with Neural Program …

Learning to Read and Calculate

!10

How many pictures were in each of the albums?

2

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

Part 2

ICML 2017

Page 30: Machine Reading and Reasoning with Neural Program …

Learning to Interpret Rules

!11

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 31: Machine Reading and Reasoning with Neural Program …

Learning to Interpret Rules

!11

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Yes

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 32: Machine Reading and Reasoning with Neural Program …

Learning to Interpret Rules

!11

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Part 3

Yes

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 33: Machine Reading and Reasoning with Neural Program …

And Ask Clarification Questions

!12

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Part 3If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 34: Machine Reading and Reasoning with Neural Program …

And Ask Clarification Questions

!12

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Part 3

Have you been working abroad 52 weeks or less?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 35: Machine Reading and Reasoning with Neural Program …

And Ask Clarification Questions

!12

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Part 3

Have you been working abroad 52 weeks or less?

Yes

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 36: Machine Reading and Reasoning with Neural Program …

And Ask Clarification Questions

!12

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Part 3

Have you been working abroad 52 weeks or less?

Yes

Yes

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 37: Machine Reading and Reasoning with Neural Program …

And Ask Clarification Questions

!12

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Part 3

Have you been working abroad 52 weeks or less?

Yes

Yes

ONGOING

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 38: Machine Reading and Reasoning with Neural Program …

Part 1: Learning to Aggregate

!13

Tim RocktäschelJohannes WelblPontus Stenetorp

Page 39: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!14

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

Which medical specialty deals with pituitary ACTH hypersecretion?

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Page 40: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!15

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

Which medical specialty deals with pituitary ACTH hypersecretion?

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Page 41: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!15

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

Which medical specialty deals with pituitary ACTH hypersecretion?

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Page 42: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!15

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

Which medical specialty deals with pituitary ACTH hypersecretion?

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Page 43: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!15

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

Which medical specialty deals with pituitary ACTH hypersecretion?

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

QuestionCode

[translates questions]

Page 44: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!16

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

What is ACTH hypersecretion created by?

Which medical specialty deals with pituitary ACTH hypersecretion?

Code

[translates questions]

Page 45: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!16

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

What is ACTH hypersecretion created by?

Which medical specialty deals with pituitary ACTH hypersecretion?

Code

[translates questions]

Page 46: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!17

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

Which specialty deals with pituitary ACTH hypersecretion?

Question

What is the pituitary a part of?

Which medical specialty deals with pituitary ACTH hypersecretion?

Code

[translates questions]

Page 47: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!17

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

Which specialty deals with pituitary ACTH hypersecretion?

Question

What is the pituitary a part of?

Which medical specialty deals with pituitary ACTH hypersecretion?

Code

[translates questions]

Page 48: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!18

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

Which specialty deals with pituitary ACTH hypersecretion?

Question

What is the pituitary a part of?

Question

What topic covers the endocrine system?

Which medical specialty deals with pituitary ACTH hypersecretion?

Code

[translates questions]

Page 49: Machine Reading and Reasoning with Neural Program …

Neural Theorem Provers

!18

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

Which specialty deals with pituitary ACTH hypersecretion?

Question

What is the pituitary a part of?

Question

What topic covers the endocrine system?

Which medical specialty deals with pituitary ACTH hypersecretion?

Code

[translates questions]

Page 50: Machine Reading and Reasoning with Neural Program …

Code

Vectors Correspond to Interpretable Rules

!19

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

Which specialty deals with pituitary ACTH hypersecretion?

Question

What is the pituitary a part of?

Question

What topic covers the endocrine system?

X deals with Y if Y produced by Z Z is a part of U X deals with U

Which medical specialty deals with pituitary ACTH hypersecretion?

Page 51: Machine Reading and Reasoning with Neural Program …

Catch: Currently only Works on Relational Data

!20

createdBy(hypersecretion, anterior pituitary)dealsWith(hypersecretion, X)

partOf(endocrine system, anterior pituitary)

dealsWith(endocrine system, endocrinology)

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

Which specialty deals with pituitary ACTH hypersecretion?

Question

What is the pituitary a part of?

Question

covers(endocrine system, X)

Code

X deals with Y if Y produced by Z Z is a part of U X deals with U

Page 52: Machine Reading and Reasoning with Neural Program …

Why Program Interpreter/Theorem Prover?

!21

createdBy(hypersecretion, anterior pituitary)

partOf(endocrine system, anterior pituitary)

dealsWith(endocrine system, endocrinology)

Rocktäschel and Riedel NIPS 2017

Agent

Amounts the Backward Chaining algorithm used in Prolog Interpreters

dealsWith(hypersecretion, X)

Page 53: Machine Reading and Reasoning with Neural Program …

Why Neural? Supports Soft Unification

!22

createdBy(hypersecretion, anterior pituitary)dealsWith(hypersecretion, X)

partOf(endocrine system, anterior pituitary)

dealsWith(endocrine system, endocrinology)

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

Which specialty deals with pituitary ACTH hypersecretion?

Question

What is the pituitary a part of?

Question

covers(endocrine system, X)

Code

X deals with Y if Y produced by Z Z is a part of U X covers U

Page 54: Machine Reading and Reasoning with Neural Program …

Why Neural? Supports Soft Unification

!22

createdBy(hypersecretion, anterior pituitary)dealsWith(hypersecretion, X)

partOf(endocrine system, anterior pituitary)

dealsWith(endocrine system, endocrinology)

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

Which specialty deals with pituitary ACTH hypersecretion?

Question

What is the pituitary a part of?

Question

covers(endocrine system, X)

Code

X deals with Y if Y produced by Z Z is a part of U X covers U

Page 55: Machine Reading and Reasoning with Neural Program …

Learn Rules by Learning Symbol Representations

!23

createdBy(hypersecretion, anterior pituitary)dealsWith(hypersecretion, X)

partOf(endocrine system, anterior pituitary)

dealsWith(endocrine system, endocrinology)

Rocktäschel and Riedel NIPS 2017

Agent

Program Interpreter

Reader

Question

Which specialty deals with pituitary ACTH hypersecretion?

Question

What is the pituitary a part of?

Question

rel62(endocrine system, X)

Code

X rel32 Y if Y rel42 Z Z rel51 U X rel62 U

Page 56: Machine Reading and Reasoning with Neural Program …

Before Learning

!24

rel32

X rel32 Y if Y rel42 Z Z rel51 U X rel62 U

rel42rel51

rel62

X deals with Y if Y produced by Z Z is a part of U X deals with U deals with

produced by

is a part of

covers

Page 57: Machine Reading and Reasoning with Neural Program …

After Learning

!25

rel32

X rel32 Y if Y rel42 Z Z rel51 U X rel62 U

rel42

rel51

rel62 X deals with Y if Y produced by Z Z is a part of U X deals with U

deals with

produced by

is a part of

covers

Page 58: Machine Reading and Reasoning with Neural Program …

Results on Benchmark (Rank of Correct Answer)

!26Rocktäschel and Riedel NIPS 2017

Page 59: Machine Reading and Reasoning with Neural Program …

Results on Benchmark (Rank of Correct Answer)

!26

0

25

50

75

100

Countries S3 UMLS NationsComplex NTP Complex NTP Complex NTP

Rocktäschel and Riedel NIPS 2017

Page 60: Machine Reading and Reasoning with Neural Program …

Results on Benchmark (Rank of Correct Answer)

!26

0

25

50

75

100

Countries S3 UMLS NationsComplex NTP Complex NTP Complex NTP

8696

48.4

Rocktäschel and Riedel NIPS 2017

Page 61: Machine Reading and Reasoning with Neural Program …

Results on Benchmark (Rank of Correct Answer)

!26

0

25

50

75

100

Countries S3 UMLS NationsComplex NTP Complex NTP Complex NTP

8999

77.386

96

48.4

Rocktäschel and Riedel NIPS 2017

Page 62: Machine Reading and Reasoning with Neural Program …

Results on Benchmark (Rank of Correct Answer)

!26

0

25

50

75

100

Countries S3 UMLS NationsComplex NTP Complex NTP Complex NTP

8999

77.386

96

48.4

Comparable or Better than Baselines, and interpretable

Rocktäschel and Riedel NIPS 2017

Page 63: Machine Reading and Reasoning with Neural Program …

Limitations

Scalability

Currently only works for KBs with < 10k facts (solved!)

Small proof depth (getting there)

Still requires relational representation (ongoing)

!27

Page 64: Machine Reading and Reasoning with Neural Program …

How to create Datasets for Multihop Reading and Reasoning?

!28

Johannes WelblPontus Stenetorp

Page 65: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!29TACL 2018

Page 66: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!29

Unlabelled Text

Knowledge Base

TACL 2018

Page 67: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!29

Unlabelled Text

Knowledge Base

Dataset Construction Method

TACL 2018

Page 68: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!29

Unlabelled Text

Knowledge Base

Dataset Construction Method

TACL 2018

Multihop Dataset

Page 69: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntitiesKB Triple Instance

Page 70: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett, citizenship, Scotland

KB Triple Instance

Page 71: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 72: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 73: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett

Jamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 74: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnettdescribed in

Jamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 75: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnettdescribed in

Jamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 76: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnettdescribed in

mentions

Jamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 77: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnettdescribed in

mentions

HamiltonJamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 78: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnettdescribed in

mentions

described in

HamiltonJamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 79: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnettdescribed in

mentions

described in

HamiltonJamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 80: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnettdescribed in

mentions

described inmentions

HamiltonJamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Page 81: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett

Scotland

described in

mentions

described inmentions

HamiltonJamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Scotland

Page 82: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett

Scotland

described in

mentions

described inmentions

HamiltonJamie Burnett, citizenship, Scotland

What is the nationality of Jamie Burnett?

KB Triple Instance

Scotland

Page 83: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett

Scotland

described in

mentions

described inmentions

HamiltonJamie Burnett, citizenship, Scotland

Yixing Open

What is the nationality of Jamie Burnett?

KB Triple Instance

Scotland

Page 84: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett

Scotland

described in

mentions

described inmentions

HamiltonJamie Burnett, citizenship, Scotland

Yixing Open

What is the nationality of Jamie Burnett?

KB Triple Instance

Scotland

Page 85: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett

Scotland

described in

mentions

described inmentions

HamiltonJamie Burnett, citizenship, Scotland

Yixing Open

What is the nationality of Jamie Burnett?

KB Triple Instance

Scotland

Page 86: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett

Scotland

described in

mentions

described inmentions

HamiltonJamie Burnett, citizenship, Scotland

Yixing Open

What is the nationality of Jamie Burnett?

KB Triple Instance

Scotland

Page 87: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!30

DocumentsEntities

Jamie Burnett

Scotland

described in

mentions

described inmentions

HamiltonJamie Burnett, citizenship, Scotland

Yixing Open

China

What is the nationality of Jamie Burnett?

KB Triple Instance

Scotland

China

Page 88: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!31

Unlabelled Text

Knowledge Base

Dataset Construction Method

[Conditionally Accepted to TACL]

Multihop Dataset

Page 89: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!32

Dataset Construction Method

WikiHopUnlabelled Text

Knowledge Base

Page 90: Machine Reading and Reasoning with Neural Program …

Dataset Construction Method

!33

Dataset Construction Method

MedHopUnlabelled Text

Knowledge Base

Page 91: Machine Reading and Reasoning with Neural Program …

Baseline Results

!34

Page 92: Machine Reading and Reasoning with Neural Program …

Baseline Results

!34

Accu

racy

[%]

0

8.333

16.667

25

33.333

41.667

50

WikiHop MedHop

RandomTF-IDFBiDAF

Page 93: Machine Reading and Reasoning with Neural Program …

Baseline Results

!34

Accu

racy

[%]

0

8.333

16.667

25

33.333

41.667

50

WikiHop MedHop

RandomTF-IDFBiDAF

13.9

11.5

Page 94: Machine Reading and Reasoning with Neural Program …

Baseline Results

!34

Accu

racy

[%]

0

8.333

16.667

25

33.333

41.667

50

WikiHop MedHop

RandomTF-IDFBiDAF

9

25.6

13.9

11.5

Page 95: Machine Reading and Reasoning with Neural Program …

Baseline Results

!34

Accu

racy

[%]

0

8.333

16.667

25

33.333

41.667

50

WikiHop MedHop

RandomTF-IDFBiDAF

47.8

42.9

9

25.6

13.9

11.5

Page 96: Machine Reading and Reasoning with Neural Program …

Reduction to Traditional Machine Comprehension

!35

Which medical specialty deals with pituitary ACTH hypersecretion?

Endocrinology

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Page 97: Machine Reading and Reasoning with Neural Program …

Reduction to Traditional Machine Comprehension

!36

Which medical specialty deals with pituitary ACTH hypersecretion?

Endocrinology A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Page 98: Machine Reading and Reasoning with Neural Program …

Do Neural Reading Models Aggregate?

!37

Which medical specialty deals with pituitary ACTH hypersecretion?

Endocrinology A major organ of the endocrine system, the anterior pituitary is the glandular, anterior lobe that ...

Pituitary ACTH hypersecretion ... is a form of hyperpituitarism characterized by an abnormally high level of ACTH produced by the anterior pituitary …

The endocrine system is ... ... The field of study dealing with the endocrine system and its disorders is endocrinology, a branch of internal medicine.

Page 99: Machine Reading and Reasoning with Neural Program …

Removing Relevant Documents, Keep Answer Documents

!38

Accu

racy

[%]

25

30

35

40

45

50

55

WikiHop MedHop

30.4

44.6

33.7

54.5

BIDAFBIDAF doc-rem 10%

Page 100: Machine Reading and Reasoning with Neural Program …

!39

TACL 2018

Page 101: Machine Reading and Reasoning with Neural Program …

Phil’s View?

Good:

You cannot just do context matching

We spent a lot of efforts in removing biases

We have extra information at annotation time we don’t release

Bad:

It is still multiple choice

Test set comes from the same process as training (kinda—-see above)

!40

Page 102: Machine Reading and Reasoning with Neural Program …

Part 2: Learning to Read and Calculate

!41

Tim RocktäschelMatko Bosnjak Jason Naradowsky

Page 103: Machine Reading and Reasoning with Neural Program …

Machine Reading and Reasoning: Math

!42

How many pictures were in each of the albums?

2

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

Page 104: Machine Reading and Reasoning with Neural Program …

Differentiable Program Interpreters

!43

Program Interpreter

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

Page 105: Machine Reading and Reasoning with Neural Program …

Differentiable Program Interpreters

!43

Program Interpreter

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

Page 106: Machine Reading and Reasoning with Neural Program …

Differentiable Program Interpreters

!43

Program Interpreter

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

Page 107: Machine Reading and Reasoning with Neural Program …

Differentiable Program Interpreters

!43

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

Page 108: Machine Reading and Reasoning with Neural Program …

Differentiable Program Interpreters

!43

0 1 2 3 4 5 6 7 8 9

34

2

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

Page 109: Machine Reading and Reasoning with Neural Program …

Differentiable Program Interpreters

!43

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

34

2

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

Page 110: Machine Reading and Reasoning with Neural Program …

0 1 2 3 4 5 6 7 8 9

34

2

d

Stack0 1 2 3 4 5 6 7 8 9p

Code

Differentiable Program Interpreters

!44

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

42

3

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

Page 111: Machine Reading and Reasoning with Neural Program …

0 1 2 3 4 5 6 7 8 9

34

2

d

Stack0 1 2 3 4 5 6 7 8 9p

Code

Differentiable Program Interpreters

!45

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

42

3

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

63

d

Stack

Page 112: Machine Reading and Reasoning with Neural Program …

0 1 2 3 4 5 6 7 8 9

34

2

d

Stack0 1 2 3 4 5 6 7 8 9p

Code

Differentiable Program Interpreters

!46

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

42

3

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

63

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

36

d

Stack

Page 113: Machine Reading and Reasoning with Neural Program …

0 1 2 3 4 5 6 7 8 9

34

2

d

Stack0 1 2 3 4 5 6 7 8 9p

Code

Differentiable Program Interpreters

!47

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

42

3

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

63

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

36

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

2

d

Stack

Page 114: Machine Reading and Reasoning with Neural Program …

0 1 2 3 4 5 6 7 8 9

34

2

d

Stack0 1 2 3 4 5 6 7 8 9p

Code

Training

!48

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

42

3

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

63

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

36

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

2

d

Stack

Page 115: Machine Reading and Reasoning with Neural Program …

0 1 2 3 4 5 6 7 8 9

34

2

d

Stack0 1 2 3 4 5 6 7 8 9p

Code

Training

!49

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

42

3

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

63

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

36

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

2

d

Stack

Page 116: Machine Reading and Reasoning with Neural Program …

0 1 2 3 4 5 6 7 8 9

34

2

d

Stack0 1 2 3 4 5 6 7 8 9p

Code

Training

!50

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

42

3

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

63

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

36

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

2

d

Stack

Page 117: Machine Reading and Reasoning with Neural Program …

0 1 2 3 4 5 6 7 8 9

34

2

d

Stack0 1 2 3 4 5 6 7 8 9p

Code

Training

!51

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

42

3

d

Stack

Program Interpreter0 1 2 3 4 5 6 7 8 9

Heap

Bosnjak et al. ICML 2017

Reader

Model

Isabel uploaded 2 pictures from her phone and 4 from her camera to facebook. She sorted the pics into 3 different albums with the same amount of pics in each album.

How many pictures were in each of the albums?

0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

63

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

36

d

Stack0 1 2 3 4 5 6 7 8 9p

Code0 1 2 3 4 5 6 7 8 9

2

d

Stackdef solve(x):

{+|-|%|*} solve(y)

Page 118: Machine Reading and Reasoning with Neural Program …

Results on Math Problems (Accuracy)

!52Bosnjak et al. ICML 2017

Page 119: Machine Reading and Reasoning with Neural Program …

Results on Math Problems (Accuracy)

!52Bosnjak et al. ICML 2017

50

61.5

73

84.5

96

Ours Seq2Seq

Page 120: Machine Reading and Reasoning with Neural Program …

Results on Math Problems (Accuracy)

!52Bosnjak et al. ICML 2017

50

61.5

73

84.5

96

Ours Seq2Seq

96

Page 121: Machine Reading and Reasoning with Neural Program …

Results on Math Problems (Accuracy)

!52Bosnjak et al. ICML 2017

50

61.5

73

84.5

96

Ours Seq2Seq

9596

Page 122: Machine Reading and Reasoning with Neural Program …

Results on Math Problems (Accuracy)

!52Bosnjak et al. ICML 2017

50

61.5

73

84.5

96

Ours Seq2Seq

9596

How many pictures were in each of the albums?

(2 + 4) / 3

Seq2Seq solves simpler problem

Page 123: Machine Reading and Reasoning with Neural Program …

Limitations

Continuous relaxations difficult to train

Hard to learn long programs

Hard to learn with recursive function calls

Need better understanding of SGD for networks with discrete/stochastic activations

!53

Page 124: Machine Reading and Reasoning with Neural Program …

Part 3: Learning to Interpret Rules and Ask Clarification Questions

!54

Marzieh Saeidi Max BartoloGuillaume BouchardTim Rocktäschel

Page 125: Machine Reading and Reasoning with Neural Program …

Learning to Interpret Rules

!55

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Yes

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 126: Machine Reading and Reasoning with Neural Program …

And Ask Clarification Questions

!56

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

Yes

Yes

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 127: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 128: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 129: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

No

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 130: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

No

No

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 131: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

No

No

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Page 132: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

No

No

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Are you working for an employer outside of the EEA?

Page 133: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

No

No

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Are you working for an employer outside of the EEA?

No

Page 134: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

No

No

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Are you working for an employer outside of the EEA?

No

No

Page 135: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

No

No

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Are you working for an employer outside of the EEA?

No Yes

No

Page 136: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!57

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

No

No

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Are you working for an employer outside of the EEA?

No Yes

No Yes

Page 137: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!58

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Are you working for an employer outside of the EEA?

Yes

Yes

Page 138: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!59

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Are you working for an employer outside of the EEA?

Yes

Yes

Page 139: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!60

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Page 140: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!61

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Are you working for an employer outside of the EEA?

Yes

Yes

Page 141: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!62

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Are you working for an employer outside of the EEA?

Yes

Yes

Page 142: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!63

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Yes

Page 143: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!64

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Yes

Page 144: Machine Reading and Reasoning with Neural Program …

Generating a Corpus

!64

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Have you been working abroad 52 weeks or less?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Yes

Yes

Created ~40k instances this way

Page 145: Machine Reading and Reasoning with Neural Program …

Seq2Seq?

!65

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 146: Machine Reading and Reasoning with Neural Program …

Seq2Seq?

!65

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Were you laid before earning at least the lower earnings limit?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Page 147: Machine Reading and Reasoning with Neural Program …

Seq2Seq?

!65

I am working for an employer in Canada since December 2017. Do I need to carry on paying UK national insurance?

Were you laid before earning at least the lower earnings limit?

If you’re self-employed You might be able to carry on paying National Insurance if you’re: - usually self-employed in the UK - working abroad temporarily

If you do, you won’t have to pay social security contributions in the country where you’re working. You can check this by completing form CA9107.

Working in any other country You’ll carry on paying National Insurance for the first 52 weeks you’re abroad if you’re working for an employer outside the EEA.

Seq2Seq with attention (to your needs)

Page 148: Machine Reading and Reasoning with Neural Program …

Conclusion

!66

Page 149: Machine Reading and Reasoning with Neural Program …

Conclusion

Great Progress in End-to-End Reading Comprehension

!66

Page 150: Machine Reading and Reasoning with Neural Program …

Conclusion

Great Progress in End-to-End Reading Comprehension

Reasoning (aggregation, calculation etc.) and conversation end-to-end is still very challenging

!66

Page 151: Machine Reading and Reasoning with Neural Program …

Conclusion

Great Progress in End-to-End Reading Comprehension

Reasoning (aggregation, calculation etc.) and conversation end-to-end is still very challenging

Our Approaches

!66

Page 152: Machine Reading and Reasoning with Neural Program …

Conclusion

Great Progress in End-to-End Reading Comprehension

Reasoning (aggregation, calculation etc.) and conversation end-to-end is still very challenging

Our Approaches

cast reasoning as program learning and execution

!66

Page 153: Machine Reading and Reasoning with Neural Program …

Conclusion

Great Progress in End-to-End Reading Comprehension

Reasoning (aggregation, calculation etc.) and conversation end-to-end is still very challenging

Our Approaches

cast reasoning as program learning and execution

are end-to-end differentiable (can be trained on downstream loss)

!66

Page 154: Machine Reading and Reasoning with Neural Program …

Conclusion

Great Progress in End-to-End Reading Comprehension

Reasoning (aggregation, calculation etc.) and conversation end-to-end is still very challenging

Our Approaches

cast reasoning as program learning and execution

are end-to-end differentiable (can be trained on downstream loss)

are inspired and tied to traditional symbolic formalisms (Forth, Prolog/Datalog)

!66

Page 155: Machine Reading and Reasoning with Neural Program …

Conclusion

Great Progress in End-to-End Reading Comprehension

Reasoning (aggregation, calculation etc.) and conversation end-to-end is still very challenging

Our Approaches

cast reasoning as program learning and execution

are end-to-end differentiable (can be trained on downstream loss)

are inspired and tied to traditional symbolic formalisms (Forth, Prolog/Datalog)

are learnt models are interpretable

!66

Page 156: Machine Reading and Reasoning with Neural Program …

Conclusion

Great Progress in End-to-End Reading Comprehension

Reasoning (aggregation, calculation etc.) and conversation end-to-end is still very challenging

Our Approaches

cast reasoning as program learning and execution

are end-to-end differentiable (can be trained on downstream loss)

are inspired and tied to traditional symbolic formalisms (Forth, Prolog/Datalog)

are learnt models are interpretable

allow injection of prior knowledge

!66

Page 157: Machine Reading and Reasoning with Neural Program …

Conclusion

Great Progress in End-to-End Reading Comprehension

Reasoning (aggregation, calculation etc.) and conversation end-to-end is still very challenging

Our Approaches

cast reasoning as program learning and execution

are end-to-end differentiable (can be trained on downstream loss)

are inspired and tied to traditional symbolic formalisms (Forth, Prolog/Datalog)

are learnt models are interpretable

allow injection of prior knowledge

create datasets

!66