I've been thinking about how neurosymbolic AI migh...
# thinking-together
n
I've been thinking about how neurosymbolic AI might be achieved. The first problem is that of memory/knowledge. Triple stores are often recommended. But I am failing to see how triples are THE definitive choice for knowledge representation. The classic example would be: How to store the fact "Bob's age is 23yrs". This maps to the Entity-Attribute-Value or Subject-Predicate-Object pattern and the triple
(Bob, age, 23yrs)
works. But on one hand, even a 2-store can be used:
Copy code
(Bob, Bob's age)
(Bob's age, 23yrs)
This has more layers of indirections, yes. But the primitives become simpler. On the other hand, if the fact was "Bob bought this camera in Singapore for 100$", the same layers of indirections show up in triple stores as well. Arbitrary knowledge seems multidimensional (time, place, context etc etc). Is there a reason to believe that triple stores achieve the best tradeoff between simplicity and expressivity?
๐Ÿ’™ 1
The alternative to triplestores that I am considering is Metagraphs as explained here by OpenCOG/Atomspace: https://github.com/opencog/atomspace/blob/master/opencog/sheaf/docs/ram-cpu.pdf
m
is the expert system winter over? ๐Ÿ˜„
๐Ÿ˜ 2
g
I concluded that triples are more practical for what I am concerned with https://guitarvydas.github.io/2021/03/16/Triples.html
โž• 1
g
Replace the text labels with token vectors. ๐Ÿค”
g
Triple stores are appealing because you can refer to a well-studied logic (Description Logic). This tells us that triple stores have a very good expressiveness:computational efficiency tradeoff.
๐Ÿ˜ฒ 1
๐Ÿ’™ 1
s
To take your specific example, in a triple store if you add
(Jane, age, 25yrs)
, it is clear that
age
represents the same attribute as the
age
in Bob's triple. It is not clear to me how this equivalence will be represented in the 2-store example.
n
@Guyren Howe That does explain a lot. Triples naturally map binary relations. "X is R-related to Y" becomes (X, R, Y). It's just that I was expecting higher arity relations (ternary and above) to be as common and important: "X, Y and Z are R-related" would map most easily to the quad (R, X, Y, Z). The simplest example being sentences describing binary _operations_: "3 plus 4 is 7".
k
I may be naive, but it makes sense to me with analogy to language structure, like Subject Verb Object. There's a lot more you can say that way than with just Subject Verb. Or maybe it makes more sense as Object Function Result.
(Jane, getAge, 25yrs)
n
@Kyle Beechly The question is: If we want expressiveness, why stop at 3? Why not 4 or 5? For example, support adverbs, adjectives, temporality, context etc natively. And if we want simplicity, why stop at 3? Why not 2? As in lisp, once a system supports pairs, we can construct linked lists, dictionaries, trees and graphs etc out of pairs quite easily.
k
@Nilesh Trivedi Why do linguists only consider Subject, Object, and Verb when composing the constituent order of a clause? I'm by no means an expert here, and don't know offhand what truly separates nouns and verbs from modifiers and adverbials to make this distinction, but there's something here that I resonate with. As for why three and not two, in analogy to linguistics, how much can we say with only one Noun and a Verb? We can say "Alice hugged," but not "Alice hugged Bob." We can say "Bob was hugged," but how do we convey the relationship between Alice and Bob? I think it can be done, but the complexity of the structure to make that happen might outweigh the complexity of adding the third aspect. Not claiming to have an answer here, just sharing my raw feels in the hope it might help point to a greater truth
๐Ÿ‘ 1
g
The triple can be considered: relation-column, id, value. So if you had a table of persons: name, dob, zip code. Then you can have triples (person-name, id, name); (person-dob, id, dob); (person-zip, id, zip). This is equivalent to a table where all the non-pk columns are nullable.
๐Ÿ’™ 2
If you flip that around, relational purists often prefer a relational model where you canโ€™t store null values, and you just do this sort of thing to represent optional values.
n
Yeah, triples are perfect for describing standalone objects. But not so much for describing rich relations between the objects. "X is parent of Y" is fine. "City1 is 100km far from City2" requires breaking it down into multiple triples, something like:
Copy code
Distance1 is_from City1
Distance1 is_to City2
Distance1 has_measure 100km
t
triplets, to me, is another representation of a graph. You have the Turing tarpit equivalent issue that everything can be transformed into a graph, so its expressivity is not a problem. But the question is about *knowledge". Graphs are great for static knowledge (Marid, captiol-of etc.), but real world knowledge often has temporal and spatial element to it. You can kinda tack it on within (graphs can represent anything!) but I think these things need their own 1st class treatment (like the brain does). "Bob lives next" door fact has in implicit today tacked on it, as opposed to objects are subjective to gravity which is nearer universal. Everything is a timeseries.
๐Ÿ‘ 1
g
Triples give you a pretty good First Order Logic, which Relational Database Theory gives us a really nice way of translating into the Relational Algebra, which is an executable data query language. Iโ€™m not waving my hands all that much when I say that a relational language is mathematically the best possible compromise between expressivity and computability. Since this is โ€œFuture of Codingโ€, and we are concerned with things like presentation and tooling, we should I think be happy to present triple stores as tables with nullable columns. That can accomodate your concerns about the dimensionality of the world.
๐Ÿ‘ 1
j
If you need to express higher arity concepts in triples, you can reify things. I've even played with storing arbitrarily nested terms with arbitrary arity. Your graph very quickly becomes unreadable visually. But unlike a tree-structured parsing of the same sort of structure, every idea or portion of one can exist only once, and is referred to instead of repeated. I don't know if it's "good", yet. But it's neat.
๐Ÿ‘ 1