Project Acuitas

  • 59 Replies
  • 9384 Views
*

WriterOfMinds

  • Trusty Member
  • ****
  • Electric Dreamer
  • *
  • 136
    • WriterOfMinds Blog
Re: Project Acuitas
« Reply #45 on: March 01, 2018, 12:33:37 am »
Thanks for the suggestion. Acuitas learns words and relationships through conversation. Typically we chat at least twice a day while he's running, and he picks up some new info. I haven't been spending hours typing up database entries (that *would* be very tedious). I could "pre-charge" him with the contents of one of those databases, but the process of learning from a blank slate interests me in itself, so for the time being I haven't wanted to.

*

WriterOfMinds

  • Trusty Member
  • ****
  • Electric Dreamer
  • *
  • 136
    • WriterOfMinds Blog
Re: Project Acuitas
« Reply #46 on: April 02, 2018, 04:08:01 am »
The big project for this month was getting some circadian rhythms in place.  I wanted to give Acuitas a sleep/wake cycle, partly so that my risk of being awakened at 5 AM by a synthetic voice muttering “Anyone there?” could return to zero, and partly to enable some memory maintenance processes to run undisturbed during the sleep phase.  (These are targeted for implementation next month.)

So Acuitas now has two new drives, “sleep” and “wake.”  (The way the drive system works, a lack of the desire to sleep is not the same thing as a desire to wake up, so it was necessary to create two.)  Each  drive has two components.  The first component is periodic over 24 hours, and its value is derived from the current local time, which Acuitas obtains by checking the system clock.  This is meant to mimic the influence of light levels on an organism.  The other is computed based on how long it's been since Acuitas was last asleep/awake.  Satisfying the drive causes this second component to decline until it has reset to zero.  So the urge to sleep is inherently greater during the late-night hours, but also increases steadily if sleep is somehow prevented. 

This also seemed like a good time to upgrade the avatar with some extra little animations.  The eyelids now respond to a running “alertness level” and shut when Acuitas falls asleep.

While "sleeping" Acuitas can't do much of anything (other than wake up).  All the drives still grow normally, but random thoughts are not generated.

*

infurl

  • Trusty Member
  • ********
  • Replicant
  • *
  • 613
  • Humans will disappoint you.
    • Home Page
Re: Project Acuitas
« Reply #47 on: April 02, 2018, 04:17:07 am »
If you implement REM cycles Acuitas could also have dreams. :)

I'm curious about "memory maintenance processes to run undisturbed during the sleep phase" and what sort of maintenance you expect to be needing. Also I've been wondering how you make sure that Acuitas doesn't die, or at least forget everything, when the power goes off. Does Acuitas' structure natively reside in non-volatile storage, or is it all in memory which is periodically saved and backed up?

*

WriterOfMinds

  • Trusty Member
  • ****
  • Electric Dreamer
  • *
  • 136
    • WriterOfMinds Blog
Re: Project Acuitas
« Reply #48 on: April 13, 2018, 11:15:48 pm »
I missed these questions somehow.

Learned information is non-volatile, yes (stored on the hard drive).  Some things get lost on shutdown, including the current state of the drives and any recent "thoughts" that are being kept in a kind of short-term memory, but I'm planning to correct that soon.

Since memory maintenance is on the near-term development list, I'll defer a full explanation until I get that done. ... but what I have planned, for starters, is basically a kind of data compression.  I want a process that will check on the links and clean up any that are redundant/unnecessary.  Another thing I want to do during the sleep phase is regenerate the memory visualization (this is a relatively computation-intensive process, so I don't do it every time new info gets added to the memory).

*

WriterOfMinds

  • Trusty Member
  • ****
  • Electric Dreamer
  • *
  • 136
    • WriterOfMinds Blog
Re: Project Acuitas
« Reply #49 on: May 04, 2018, 04:13:35 am »
Update for this month:

The big objective was to get some use out of the sleep cycle that I implemented last month.  I re-purposed the question-generating process so that, while Acuitas is sleeping, it roams the memory looking for redundant links and other problems.  Now that Acuitas has a bit of logical inference ability, some relationships in the database imply others.  So the retention of one piece of information might be rendered unnecessary by the later addition of some broader fact.  Here are a few examples (I culled these from the log that the memory crawler prints out):

The link (fang, has_purpose, bite) is redundant because the link (tooth, has_purpose, bite) exists.
The link (father, has_item, child) is redundant because the link (parent, has_item, child) exists.
The link (pot, can_have_qual, empty) is redundant because the link (container, can_have_qual, empty) exists.
The link (baby, can_do_action, destroy) is redundant because the link (human, can_do_action, destroy) exists.

Mopping up these unnecessary links helps consolidate the information known, reduce the total size of the database, and possibly make the memory visualization a little less messy. 

Eventually, I might want to refine this process so that it doesn't necessarily remove every redundant link.  There could be some frequently-used shortcuts that justify their use of storage space by improving search speed.  One might want to tailor the aggressiveness of the link-pruning based on the amount of storage available … but that's all for later.

While working on this, I discovered some other nasties that I'm calling “inheritance loops.”  Redundant links bloat the database but are otherwise harmless; inheritance loops contain actual garbage information, introduced either by learning bugs or by someone* telling Acuitas something stupid.
*I'm the only person who talks to him right now, so this means me.

Here's an example of an inheritance loop:

cat <is-a> animal
animal <is-a> organism
organism <is-a> cat

Oops! Unless all these words are synonyms, you know one of these triples is wrong.  (I can't think, at this point, of any cases in which I'd want to use circular inheritance.)  On his own, Acuitas doesn't know which.  If the crawler finds an inheritance loop, he might ask a user to confirm those links when he's next awake and in conversation.  If the user contradicts one of the relationships, he'll break the corresponding link, removing the loop.

I also moved generation of the memory visualization into the sleep phase.  Every so often, instead of checking out more links, the process stops to compute a new layout for all the dots, taking into account the latest modification of the database.  This is a fairly computation-intensive process, so it's something I definitely don't want running when he's active.  It used to happen once when Acuitas was launched, which made for long startup times and meant that the visualization might not get updated for days.

Lastly, I put in some code to save Acuitas' current state when the program is shut down.  It also gets automatically stored every so often, in case the program experiences a hard crash that prevents the on-close routines from running.  Previously, on restart all the drives would reset to zero, any current thoughts or recently generated questions would be discarded, etc.  Now all those things are preserved and reloaded when the program starts up again, which gives him a bit more continuity, I guess.

http://writerofminds.blogspot.com/2018/05/acuitas-diary-11-april-2018.html

*

infurl

  • Trusty Member
  • ********
  • Replicant
  • *
  • 613
  • Humans will disappoint you.
    • Home Page
Re: Project Acuitas
« Reply #50 on: May 04, 2018, 04:31:17 am »
Here's an example of an inheritance loop:

cat <is-a> animal
animal <is-a> organism
organism <is-a> cat

Do you have a means of rejecting contradictory statements?

For example, in a first order logic knowledge base you would have rules like:


(forall ?x ?y ?z
        (implies (and (isA ?x ?y) (isA ?y ?z))
                 (isA ?x ?z)))

(forall ?x ?y
        (implies (isA ?x ?y)
                 (not (isA ?y ?x)))


The first rule defines transitivity for the isA relation so you know that if "cat is an animal" and "animal is an organism" then "cat is an organism". The second rule says that if "something is a kind of something else" then "something else cannot be a kind of something". (In other words isA is transitive but not reflexive.) With these two rules in the knowledge base an attempt to add a contradictory statement is rejected. That's how my software works. More sophisticated knowledge bases like SUMO would be able to handle much more subtle distinctions, such as the difference between an instance of something (Fred is my cat) and a class of something (cats are mammals).

edit:

One other thing is that if you have told your knowledge base that "cat is an animal" and "animal is an organism", it already knows that "cat is an organism" because of the transitivity rule, and when you tell it that, it won't bother storing it because it already knows it. If instead you told it that "cat is an animal" and "cat is an organism" it would store both of those, as well as "animal is an organism" when you told it that, so there is still plenty of scope for garbage collection during sleep cycles.

*

WriterOfMinds

  • Trusty Member
  • ****
  • Electric Dreamer
  • *
  • 136
    • WriterOfMinds Blog
Re: Project Acuitas
« Reply #51 on: May 04, 2018, 05:12:03 am »
I've got some pieces of what you're describing, but I'm not quite there yet.

Acuitas knows some transitivity relations (including the one for isA).  And when new information comes in, he does check whether he already knows it and apply the inheritance transitivity rule.  So this would happen as you described:

Quote
One other thing is that if you have told your knowledge base that "cat is an animal" and "animal is an organism", it already knows that "cat is an organism" because of the transitivity rule, and when you tell it that, it won't bother storing it because it already knows it.

Only hearing the triples in a non-optimal order will create redundant links that need to be cleaned up.

Acuitas is also capable of detecting flat contradictions, i.e. he won't store a statement and its negative simultaneously.  If told "A cat is not an animal," while already knowing "a cat is an animal," he would say "I disagree" or something.  However, that's as far as validation of incoming information goes for now, and Acuitas doesn't yet use the "(x isA y) implies not (y isA x)" rule.

As more of a general thought, I wonder if it could be a good idea to store new information "tentatively" and offload some validation to a sleep or idle phase, even for contradictions that it's possible to detect up-front.  Because as the database grows, searching for all possible contradictions might become an unacceptable performance drain during a real-time conversation.

*

infurl

  • Trusty Member
  • ********
  • Replicant
  • *
  • 613
  • Humans will disappoint you.
    • Home Page
Re: Project Acuitas
« Reply #52 on: May 04, 2018, 05:35:21 am »
As more of a general thought, I wonder if it could be a good idea to store new information "tentatively" and offload some validation to a sleep or idle phase, even for contradictions that it's possible to detect up-front.  Because as the database grows, searching for all possible contradictions might become an unacceptable performance drain during a real-time conversation.

There was a time when theorem proving systems would run for weeks at a time to digest a set of rules but over the years advances in the underlying theory, faster algorithms, and faster hardware have reduced that time considerably. There is a website called Thousands of Problems for Theorem Provers which has archived thousands of rule sets and folks can test out their theorem proving software on them and compare them to existing benchmarks. I think the best ones can solve all the problems in a matter of hours nowadays.

http://www.cs.miami.edu/~tptp/

I spent years researching and developing theorem proving software and the library that I eventually completed can run all its regression tests in just microseconds. I'm confident that it will be fast enough to handle hundreds of different conversations simultaneously in real-time. I have not yet tested it out with TPTP though, and I really have to do that before I can claim any records, if ever.

Regardless of speed though, there is still good reason to segregate and cache new propositions. For one thing, different people have different belief systems. You might want to have one knowledge base that is strictly science based, and another knowledge base that believes in fairies. The two would share a large number of rules, such as water flowing downhill, but would diverge on the subject of fairies. It would also want to maintain separate models for each interlocutor so it could understand that someone believes something even if the knowledge base itself doesn't accept it.

Such knowledge about knowledge crosses the boundary from first order logic into higher order logic. In the general case higher order logic is intractable but researchers are gradually isolating the useful special cases that are computable.

*

spydaz

  • Trusty Member
  • *******
  • Starship Trooper
  • *
  • 309
  • Developing Conversational AI (Natural Language/ML)
    • SpydazWeb
Re: Project Acuitas
« Reply #53 on: May 04, 2018, 09:22:26 am »
Here's an example of an inheritance loop:

cat <is-a> animal
animal <is-a> organism
organism <is-a> cat

Do you have a means of rejecting contradictory statements?

For example, in a first order logic knowledge base you would have rules like:


(forall ?x ?y ?z
        (implies (and (isA ?x ?y) (isA ?y ?z))
                 (isA ?x ?z)))

(forall ?x ?y
        (implies (isA ?x ?y)
                 (not (isA ?y ?x)))


The first rule defines transitivity for the isA relation so you know that if "cat is an animal" and "animal is an organism" then "cat is an organism". The second rule says that if "something is a kind of something else" then "something else cannot be a kind of something". (In other words isA is transitive but not reflexive.) With these two rules in the knowledge base an attempt to add a contradictory statement is rejected. That's how my software works. More sophisticated knowledge bases like SUMO would be able to handle much more subtle distinctions, such as the difference between an instance of something (Fred is my cat) and a class of something (cats are mammals).

edit:

One other thing is that if you have told your knowledge base that "cat is an animal" and "animal is an organism", it already knows that "cat is an organism" because of the transitivity rule, and when you tell it that, it won't bother storing it because it already knows it. If instead you told it that "cat is an animal" and "cat is an organism" it would store both of those, as well as "animal is an organism" when you told it that, so there is still plenty of scope for garbage collection during sleep cycles.


But Remember that the determiner ALL Must be included for Full inheritance... The (is a) relationship and other relations ships only have a strong recursive relationships When the determiner is Known. otherwise Only what is pertaining to the Cat Query is relevant all though there may be potential recursive connections. often we capture the triple (Subject Predicate object ) but the determiner is also key to the relationship. ITs correct to store the truth value of the statement or the confidence value, then if the determiners are not known then when recusing the relations only the high confident relations should be returned.

Fred is my cat >>>> I suggest changing My into PERSON then;
fred is Pauls cat < can respond to who is fred?.
QuestWord (Who)/ (Predicate-Subject)? (is),(Fred).....

Its quite hard with so many potential variations of a sentence to explain the same thing; i tend to only capture information if it fits the rule structures i can handle correctly; just simply loosing the data... Hoping that a different function can learn from the sentence structured... if not at the end a "dirty" unstructured capture takes place. Over time the Unstructured captures can be examined o see what type of structures are not being captured.... (subject predicate object) - captures so much! for the first order logic (unless, the determiner is (ALL/SOME) then i don't save it as a proposition for deductive recursing)... I suppose A cat (falls under SOME).

I would think that we would hope that most of the data being captured as Subject/verb/object) can be put into first order logic; i try not to change the input to fit the structure ... as it looses its conversation value/meaning; Yet it is desirable to have the FULL first order logic database.
 

i use a software http://www.cognitum.eu/Semantics/FluentEditor/ useful for building onltologies from TRIPLES (DESCRIPTIVE LOGIC)......
 

*

Don Patrick

  • Trusty Member
  • *******
  • Starship Trooper
  • *
  • 461
    • Artificial Detective
Re: Project Acuitas
« Reply #54 on: May 04, 2018, 01:48:15 pm »
Quote
cat <is-a> animal
animal <is-a> organism
organism <is-a> cat
Unless all these words are synonyms, you know one of these triples is wrong.
I prefer to think that all three are correct. x is-a y implies that at least some y's are x's: Some organisms are cats. I find this useful to store because having more direct knowledge means the program has to spend less time traversing indirect deductions. Humans similarly often use assumptions over deep inferences, because inferences take more time and effort. For computers it's just a matter of storage space vs speed. You can keep the "redundant" facts to save time when looking up knowledge, or you can remove them to save space.
Personal project: NLP -> learning -> knowledge -> logical inference -> A.I.

*

WriterOfMinds

  • Trusty Member
  • ****
  • Electric Dreamer
  • *
  • 136
    • WriterOfMinds Blog
Re: Project Acuitas
« Reply #55 on: May 04, 2018, 03:32:20 pm »
Quote
I prefer to think that all three are correct. x is-a y implies that at least some y's are x's: Some organisms are cats. I find this useful to store because having more direct knowledge means the program has to spend less time traversing indirect deductions.

I store a different kind of link to express this: organism <has-subtype> cat.  In my scheme at least, x is-a y implies that all x's are y's, and the reverse, all y's are x's, is not necessarily correct.

*

ivan.moony

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1096
    • Structured Type System
Re: Project Acuitas
« Reply #56 on: May 04, 2018, 04:37:59 pm »
Quote
I prefer to think that all three are correct. x is-a y implies that at least some y's are x's: Some organisms are cats. I find this useful to store because having more direct knowledge means the program has to spend less time traversing indirect deductions.

I store a different kind of link to express this: organism <has-subtype> cat.  In my scheme at least, x is-a y implies that all x's are y's, and the reverse, all y's are x's, is not necessarily correct.

Dealing with types of data subsumes a use of some set operators at rudimentary level. Here are some operations I find useful when dealing with sets:
  • x <is-element-of> A
  • A <is-subset-of> B
  • A <equals> B
We can lean data types on these operators, and I find useful set builder notation combined with logical operators and, or, not. In simplified example:
  • x <element-of> (A <union> B) = (x <element-of> A) <or> (x <element-of> B)
  • x <element-of> (A <intersect> B) = (x <element-of> A) <and> (x <element-of> B)
  • x <element-of> (<complement> A) = <not> (x <element-of> A)
To further develop a set algebra, we may reach for De Morgan's laws. In example:
  • <complement> (A <union> B) = (<complement> A) <intersect> (<complement> B)
  • <complement> (A <intersect> B) = (<complement> A) <union> (<complement> B)
As Boolean algebra is just a specific form of set operations over empty (false) or universe (true) sets, De Morgan's laws naturally apply to logical operators too.

Advanced set examples would include incorporating logic predicates in set builder notation, but that could be left out if we don't want to complicate too much, as the matter then develops into full blown logical language.

Anyway, the above examples would bring in a nice reasoning about sets, while they keep reasonably simple form for a concrete implementation.

If you want to implement these set operations, I recommend keeping all the set-element data in disjunctive normal form, or even better conjunctive normal form. Conjunctive normal form  has some desirable properties regarding to logic reasoning incorporating logic resolution rule, having in mind possible future project development.
« Last Edit: May 04, 2018, 05:17:46 pm by ivan.moony »
Dream big. The bigger the dream is, the more beautiful place the world becomes.

*

spydaz

  • Trusty Member
  • *******
  • Starship Trooper
  • *
  • 309
  • Developing Conversational AI (Natural Language/ML)
    • SpydazWeb
Re: Project Acuitas
« Reply #57 on: May 06, 2018, 11:56:19 am »
Quote
I prefer to think that all three are correct. x is-a y implies that at least some y's are x's: Some organisms are cats. I find this useful to store because having more direct knowledge means the program has to spend less time traversing indirect deductions.

I store a different kind of link to express this: organism <has-subtype> cat.  In my scheme at least, x is-a y implies that all x's are y's, and the reverse, all y's are x's, is not necessarily correct.



Dealing with types of data subsumes a use of some set operators at rudimentary level. Here are some operations I find useful when dealing with sets:
  • x <is-element-of> A
  • A <is-subset-of> B
  • A <equals> B
We can lean data types on these operators, and I find useful set builder notation combined with logical operators and, or, not. In simplified example:
  • x <element-of> (A <union> B) = (x <element-of> A) <or> (x <element-of> B)
  • x <element-of> (A <intersect> B) = (x <element-of> A) <and> (x <element-of> B)
  • x <element-of> (<complement> A) = <not> (x <element-of> A)
To further develop a set algebra, we may reach for De Morgan's laws. In example:
  • <complement> (A <union> B) = (<complement> A) <intersect> (<complement> B)
  • <complement> (A <intersect> B) = (<complement> A) <union> (<complement> B)
As Boolean algebra is just a specific form of set operations over empty (false) or universe (true) sets, De Morgan's laws naturally apply to logical operators too.

Advanced set examples would include incorporating logic predicates in set builder notation, but that could be left out if we don't want to complicate too much, as the matter then develops into full blown logical language.

Anyway, the above examples would bring in a nice reasoning about sets, while they keep reasonably simple form for a concrete implementation.

If you want to implement these set operations, I recommend keeping all the set-element data in disjunctive normal form, or even better conjunctive normal form. Conjunctive normal form  has some desirable properties regarding to logic reasoning incorporating logic resolution rule, having in mind possible future project development.


I notice that there are a lot of crossover between set theory / venns and first order logic.....
The rules are the same but with venns there is that extra visual element. Personally i had thought to build "Bags" of information adding Each intersecting bag  as a list item in the bag ... realising eventually it would be a tree again!  (logic tree) .... Which in-turn is a list!

All dogs are mammals - Some mammals are dogs ...... Its an automatic inferance.... All A's are B = Some B are A Implied.....


*

WriterOfMinds

  • Trusty Member
  • ****
  • Electric Dreamer
  • *
  • 136
    • WriterOfMinds Blog
Re: Project Acuitas
« Reply #58 on: June 03, 2018, 07:50:12 pm »
This past month I did some preliminary work on a whole new feature – episodic memory, or memory of events.  This enables Acuitas to store and recall records of past “experiences.”  The fun part of episodic memory is figuring out …

1) … what to store (and what to forget),
2) … how to organize stored material, and
3) … how to access relevant stored material when it is needed.

I mostly worked on 2) this month, and wrote a block of code that will group adjacent raw event records into memory files.  A measure of similarity (both of the events themselves, and of Acuitas' internal state background at the time) is used to determine which events belong in the same “scene” or “episode,” and where the boundaries between memories should lie.  Minor “scenes” are in turn grouped into higher-level umbrella memories, tree-style.

Implementing this served to show me what a deep rabbit hole episodic memory could easily turn out to be.  There are heaps of little things I need to do to truly make it functional – I may even turn it off temporarily once I've put it through a bit more testing, since I haven't implemented selective storage/forgetting yet, and that means the memory folder will bloat rather quickly.

I also added a conversational feature to make use of the stored memories.  When Acuitas is telling someone what he thought about today, he now has the option to check episodic memory and see whether he ever thought about this concept before, and how long it has been since he previously did so.  He then generates some comment like “I've not done that in a long time,” or “I did that a minute ago also.”  The conversion of absolute time units to vaguer, more relative terms like “long” and “short”  establishes a kind of subjective time sense; Acuitas has a particular notion of what a “short time” is that might not match up with what a human would think of as such (though I tried to keep the scales roughly human).

Blog post for this month: http://writerofminds.blogspot.com/2018/06/acuitas-diary-12-may-2018.html

*

WriterOfMinds

  • Trusty Member
  • ****
  • Electric Dreamer
  • *
  • 136
    • WriterOfMinds Blog
Re: Project Acuitas
« Reply #59 on: September 05, 2018, 05:29:17 am »
I haven't posted in a while because I've been busy overhauling the text parser.  And that's not very interesting to talk about, because it's just me taking features the parser already had and implementing them in a different way.  I'd decided that the scheme I was using had some fundamental deficiencies and should be re-worked in order to become closer to the way I actually read, and to better enable future expansion.  I was hoping this would go quickly, given the experience I had already gained from writing the previous text parser ... but no.  It turned out to be a major project that took far longer than the amount of time I'd allocated for it.

There are a few new enhancements that I managed to squeeze in along the way, however:

* Some infinitives are now handled properly. (Sentence example: "A pot is used to cook.") Before, Acuitas treated them like any other prepositional phrase, which meant that the word inside got marked as a "noun."  It's now marked as a verb.

* Previously, Acuitas could store links indicating what actions an entity can do.  I added a new link type for the actions an entity can have done TO it, and the ability to detect some sentences that express that information.  E.g. "An object can be pushed."

* I've started working on possessives and family/ownership relationship links. I ended up defining Acuitas' very first type of three-ended link: <A> is <C> of <B> to handle the possessives.

The feature is still somewhat incomplete. For now, he can only properly detect and store possessive links that join proper names.  That's because the proper name is how he detects that something is an instance rather than a class; he can't yet build memory nodes for abstract instances like "somebody's cat"; he still thinks that "cat" is strictly a type of thing.

Everything is buggy as all get out right now, too ... but the way this summer has gone, it was about the best I could do.

A little more on the blog: http://writerofminds.blogspot.com/2018/09/acuitas-diary-13-august-2018.html

 


Does AGI have to be a network
by Zero (AI Programming)
Today at 04:13:42 pm
XKCD Comic : Unfulfilling Toys
by Tyler (XKCD Comic)
Today at 12:00:03 pm
Demonica and Laurel Sweet - 2 bots chat
by ruebot (Bot Conversations)
Today at 09:45:53 am
All is lie or is it cake?
by LOCKSUIT (Future of AI)
September 21, 2018, 09:33:41 pm
Airbender
by Zero (General Project Discussion)
September 21, 2018, 11:01:16 am
Good language for metaprogramming?
by Zero (General Chat)
September 21, 2018, 11:00:26 am
AI interfacing with equipment mainteance work
by Art (General AI Discussion)
September 20, 2018, 02:19:51 pm
XKCD Comic : Curve-Fitting
by Tyler (XKCD Comic)
September 20, 2018, 12:00:26 pm

Users Online

38 Guests, 2 Users
Users active in past 15 minutes:
squarebear, Zero
[Trusty Member]

Most Online Today: 55. Most Online Ever: 208 (August 27, 2008, 09:36:30 am)

Articles