Determining if the user has changed a subject

Oh man, y’all stepped on what is going to be one of the hardest problems in creating AGI! Basically, the entire human brain is recruited for these kinds of attention tasks, so our first forays are going to be extremely sloppy. I’m sure some computer scientists will come up with better models eventually but right now this is the Wild West.

In his book On Task David Badre talks extensively about how our brains use cognitive control to handle multiple tasks, track them to completion, and so on. Really you only need to read the first two or three chapters to see how complex this is as a problem.

Anyways, I’ve been putting thought into how to handle task switching and specifically, carrying tasks through to completion. I would caution against brute force methods. The reason is that you are going to build a custom solution that will only work for one particular architecture and then break as soon as you make other structural changes. In effect, this means that I recommend you create a solution that can engage with an arbitrary data source, such as a SQL database or search index like ElasticSearch or SOLR.

It just so happens I was reading up on txtai, which should aid us greatly in this problem.

Let us assume that you have a database of all past user interactions in something like SQLITE or ElasticSearch. Every human could handle the query “Call mom” if they are talking with someone who they are close with. Say a spouse or a sibling.

First you have to establish intention - I recommend establishing intent with every new message (be it chat, verbal, etc). This is the first method of detecting changes in subject/task. I have some intent prompt examples in the Appendix of my book. So with a good intent extractor you’ll get something like End user NSY wants me to call their mother

This function begs a few questions and must be mapped to a few information problems:

  1. Who is NSY’s mother?
  2. What is NSY’s mother’s phone number?

Fortunately for you, I just wrote a fine-tuned question generator that can assist with this exact kind of problem! (internal questions are one way of articulating what our brains do when engaging with tasks, also, curiosity)

You must then use semantic search over your data to answer those questions. If the information isn’t available, you must generate a dialog to ask the end user. This method of breaking tasks into constituent information problems is basically how the brain works, and holds each problem in working memory.

Anyways, I’m working on a better Shared Database service as outlined in the book. I’ll post about it when I’m done. It should help with these kinds of problems immensely as it will have integrate semantic search, thus greatly enhancing the ability to answer questions.

EDIT: One thing I did wrong with the existing question asking dataset is that I didn’t include usernames. I will have to fix that one day.