The first paragraph after the heading "Mathematical Formulation of the Problem" is hard for me to parse, and I cannot rule out that it contains (at least) a typo.
Yes, but also, resolutions of human preference conflicts should eventually be done with some input from human meta-preferences, not solely in the simplest way.
I wonder whether this framework allows for meta-preferences to play a role. Maybe first-order logic constraints on the graph edits, or penalties for specific edits (e.g. removing edges is 1.5 times worse than adding edges…)
cross-posted from niplav.github.io
Epistemic Status
This is still a draft that I was told to already post here, which includes working (but very slow) code for one special case. Hopefully I'll be able to expand on this in the next ~half year.
Turning Some Inconsistent Preferences into Consistent Ones
— Yew-Kwang Ng, “Towards Welfare Biology: Evolutionary Economics of Animal Consciousness and Suffering” p. 1, 1995
— Tsong Yueh Chen/Fei-Ching Kuo/Robert G. Merkel/T.H. Tse, “Adaptive Random Testing: the ART of Test Case Diversity”, 2010
Consider an agent which displays (von Neumman-Morgenstern) inconsistent preferences, for example choosing two incompatible options in the two scenarios in the Allais paradox, or reliably displaying cycles in its actions (detecting which actions are in fact caused by inconsistent preferences, and not just exotic ones from weird abstractions, is considered a separate problem here). We might want to interact with that agent, e.g. trade with it, help it (or exploit it), or generally know how it will act But how to go about that if the agent displays inconsistent preferences? Perhaps it might even be the case that humans are such agents, and find ourselves in a conundrum: we know our preferences are inconsistent and reliably exploitable, and that agents with such preferences reliably fare worse in the world, we might want to change that.
A possible approach to this problem has two steps:
Mathematical Formulation of the Problem
Define a set of possible (von Neumann-Morgenstern) inconsistent preferences over a set W of worlds as ⋎/, and the set of consistent preferences over those worlds as ⋎. Elements from those sets are written as ≿∈⋎/ and ⪰∈⋎.
One way we could approach the problem is by trying to turn those inconsistent preferences consistent, i.e. constructing a function t:⋎/↦⋎ that takes an inconsistent preference ≿ and transforms it into a consistent preference ⪰, while retaining as much of the original structure of the preference as possible (it would make little sense if we replaced the original preference relation with e.g. indifference over all options).
Formally, we want to find for some given distance metric d:⋎/×⋎↦R a function t so that
t=argmin td(≿,t(≿))⪰=t(≿)
I call this function a turner, and sometimes call the results of that function the set of turnings (an element from that set is a turning). The names mostly chosen for not having been used yet in mathematics, as far as I know, and because I want to be a little extra.
A solution to the problem of turning inconsistent preferences into consistent ones then has these components:
Related Work
This work is closely related to the investigations in Aird & Shovelain 2020 (so closely that even though I believe I re-invented the approach independently, it might just be that I had read their work & simply forgotten it), and broadly related to the value extrapolation framework outlined in Armstrong 2022.
Discrete Case
When we have discrete sets of worlds W, we can represent an inconsistent preference over those worlds by using a directed graph G≿=(W,E≿⊆W×W). The presence of an edge (w1,w2) would mean that w1≿w2, that is w1 is preferred to w2.
Mathematically, then, ⋎/ is the set of all possible graphs with edges in W×W, that is ⋎/={(W,E)|E∈P(W×W))}).
The consistent equivalent to an inconsistent preference represented by a directed graph would be a path graph G⪰=(V,E⪰) over the same set of vertices W. The method for transforming G≿ into G⪰ would be by adding/deleting the minimal number of vertices from E≿.
Mathematically, then ⋎ is the set of transitive closures of all possible path graphs that are encode permutations of W; ⋎={(V,E)+|E∈σ(W)}.
Example
Consider the following directed graph:
Here, W={a,b,c,d,e,f,g}.
An edge from a to b means that a is preferred to b (short a≿b). The absence of an edge between two options means that those two options are, from the view of the agent, incomparable.
It violates the two von Neumann-Morgenstern axioms for discrete options:
A possible turned version of these preferences could then be the following graph:
This graph looks quite messy, but it's really just the transitive closure of this graph:
Whether this is the "right" way to turn the previous inconsistent preferences depends on the choice of distance metric we would like to use.
Resolving Inconsistencies
In some sense, we want to change the inconsistent preferences as little as possible; the more we modify them, the more displayed preferences we have to remove or change. Since the presence or absence of preferences is encoded by the presence or absence of edges on the graph, removing edges or adding new edges is equivalent to removing or adding preferences (at the moment, we do not consider adding or removing vertices: we stay firmly inside the agent's ontology/world model).
Luckily, there is a concept in computer science called the graph-edit distance: a measure for the difference between two graphs.
The set of possible editing operations on the graph varies, e.g. Wikipedia lists
—English Wikipedia, “Graph Edit Distance”, 2021
Since we do not have labels on the edges of the graph, and have disallowed the deletion or insertion of vertices, this leaves us with the graph edit distance that uses edge insertion and edge deletion.
We can then write a simple pseudocode algorithm for ⪰=f(≿):
where
perm(W)
is the set of permutations onW
,trans_closure(G)
is the transitive closure of a graphG
, andged(G1, G2)
is the graph edit distance fromG1
toG2
.Or, mathematically,
R=argmin R∈σ(W)GED(R+,G≿))
Implementation
Implementing this in Python 3 using the networkx library turns out to be easy:
We can then test the function, first with a graph with a known best completion, and then with our example from above.
The small example graph (top left) and its possible turnings are (all others):
This looks pretty much correct.
This is actually equal to the hypothesized solution from above (below is the non-transitive-closure version):
Problems with This Method and its Algorithm
This solution has some glaring problems.
Speed (or the Lack Thereof)
Some of you might have noticed that this algorithm is somewhat inefficient (by which I mean absolutely infeasible).
Since we iterate through the permutations of W, the runtime is O(|W|!) (with the added "benefit" of additionally computing the NP-complete graph edit distance inside of the loop, which is also APX-hard to approximate).
Possible better approaches would involve finding the longest subgraph that is a path graph, or the spanning tree, perhaps the transitive reduction is helpful, or maybe the feedback arc set?
Non-Unique Results
Another, smaller problem is that the algorithm often doesn't have a unique result, as seen in the small example above.
We can compute the set of all possible turnings with some trivial changes to the algorithm:
and its implementation
The results, with the small example, are as expected:
For the big example, after waiting a while for the solution:
I will not list them all, but these are less than the 7!=5040 possible options.
This brings up an interesting question: As we have more and more elaborate inconsistent preferences over more worlds, does it become more likely that they have a unique consistent preference they can be turned to? Or, in other words, if we make the graphs bigger and bigger, can we expect the fraction of inconsistent preferences with a unique turning to grow or shrink (strictly) monotonically? Or will it just oscillate around wildly?
More formally, if we define Gn as the set of graphs with n nodes, and Un={G∈Gn|1=|turn_all(G)|} as the set of graphs with n nodes that have unique path graphs associated with them.
We can further define the set of all graphs wwith n nodes with m turnings as Tn,m={G∈Gn|m=|turn_all(G)|} (of which Un=Tn,1 is just a special case).
We can call the size of the set of all turnings of a graph the confusion of that graph/set of inconsistent preferences: If the graph is already the transitive closure of a path graph, the size of that set is (arguendo) 1: there are no other possible turnings. If the graph contains no edges (with n nodes), the confusion is maximal with n!, the preferences carry the minimal amount of meaning.
Minimal and Maximal Number of Turnings
The minimal number of turnings a graph can have is 1, with a graph-edit distance of 0: any transitive closure of a path graph satisfies this criterion (if your preferences are already consistent, why change them to be more consistent?)
However, those graphs aren't the only graphs with exactly one turning, consider the following graph (left) and a possible turning (right) (with graph-edit distance 1; the changed edge is red, a nice opportunity for some rubrication):
One can easily see that it has exactly one turning, and checking with the code confirms:
For a graph with n nodes the maximal number of turnings it is upper-bounded by n!, and a sufficient condition for the graph to have that many turnings is when the graph is the union of a set of complete digraphs with disjoint nodes. For example the graph with 4 nodes and no edges has 24 possible turnings, as does the graph with 4 nodes and two edges {(1,2),(2,1)}.
We can prove this inductively: When considering a node-labeled graph with n nodes and no edges, the graph edit distance to any path graph variant of that graph is the same, because we always have to add n−1+n−2+n−3…1=n−1+(n−1)22 edges to reach any transitive closure of a path graph (by the sum of any arithmetic progression). Let not G∘ be a graph with n nodes that is solely the union of complete digraphs with disjoint nodes. When we now pick two nodes u and v from G∘ and add the edges {(u,v),(v,u)}∪{(v,x)|(u,x)∈E∘}∪{(u,y)|(v,x)∈E∘}}∪{(x,y)|(u,x)∈E∘,(v,y)∈E∘} (that is, we connect u and v, and all their neighbors) to G∘, we have necessarily increased the graph-edit distance to any path graph by the same amount, we have symmetrically added edge-pairs that need to be broken in either direction.
Questions
One can now pose several (possibly distracting) questions:
turn
a graph G or the transitive closure of G?Number of Turnings for Gn
We can check these empirically! While it would be nice to prove anything about them, it's much nicer to investigate them computationally. This is pretty straightforward: For increasing n, generate Gn, for every G∈Gn, compute |turn_all(G)|, save the data in a file somewhere, and do interesting things with that data.
In code, we first generate all directed graphs with n nodes with a recursive function
and start turning:
However, my computer quickly freezes and I find out that this is a lot of graphs:
So the number directed graphs with 5 nodes would be 232=4294967296, far too many for my puny laptop. But instead of generating them all, one can just generate a random sample and test on that, using the Erdős–Rényi model, for which networkx has the helpful function
generators.random_graphs.gnp_random_graph
(Wikipedia informs us that "In particular, the case p=12 corresponds to the case where all 2(n2) graphs on n vertices are chosen with equal probability."). We have to randomly add reflexive edges (not included in the model, it seems) with probability 12 each, and labels for the nodes, and then we're good to go:We now run the script in the background, happily collecting data for us (
python3 collect.py >.https://niplav.github.io/../data/turnings.csv &
), and after a nice round of editing this text go back and try to make sense of the data, which runs squarely counter my expectations:It seems like the mean number of turnings actually increases with the graph size! Surprising. I'm also interested in the exact numbers: Why exactly 3.390289… for the graphs with 4 nodes? What is so special about that number‽ (Except it being the longitude of the Cathedral Church of Christ in Lagos).
Looking at unique turnings turns (hehe) up further questions:
Very much to my surprise, searching for "2,2,46,3640" in the OEIS yields no results, even though the sequence really looks like something that would already exist! (I think it has a specifically graph-theoretic "feel" to it). But apparently not so, I will submit it soon.
I omit the number of unique turnings for 5 and 6, for obvious reasons (I also believe that the ratio for 6 is an outlier and should not be counted). The number of unique resolutions for the graph with 1 node makes sense, though: Removing the reflexive edge should count as one edge action, but the graph only has one unique resolution:
Encoding Inconsistencies
Theory
Assuming that we have a set of axioms that describe which preferences are consistent and which are inconsistent, for the purposes of this text, we want to ideally find a set ⋎/ of mathematical structures that
Discrete Case
The two relevant von Neumman-Morgenstern axioms are completeness and transitivity, with a directed graph one can also represent incompleteness and intransitivity.
Incompleteness
Incompleteness (or incomparability) between two options w1,w2 can be represented by not specifying an edge between the two options, that is (w1,w2)∉E,(w2,w1)∉E.
Intransitivity
Intransitivity can be represented by cycles in the graph:
Non-Encodable Inconsistencies
With option set {a,b} have preference a≿b, with option set {a,b,c} have preferences b≿a,a≿c,b≿c.
Continuous Case
Incompleteness
Intransitivity
Curl in the vector field?
Discontinuity
Can only exist with incompleteness?
Dependence
Discussion
This leads to an interesting ethical consideration: is it a larger change to a preference relation to add new information or remove information?
It is discussed how to incorporate those weights into an algorithm for minimally transforming G≿ into G⪰.
Continuous Case
Vector Fields over Probability Simplices
Vector field over the probability simplex over the options (representing local preferences over lotteries).
Resolving Inconsistencies
Find mapping from vector field to another that makes the vector field consistent by minimizing the amount of turning/shrinking the vectors have to perform.
Graphons
?
Look into extremal graph theory.
Implications for AI Alignment
—Patricia Taxxon, “Hellbulb” from “Gelb”, 2020
Ambitious Value Learning
Learn human values, check if known inconsistencies are encoded (to ensure learning at the correct level of abstraction), then make consistent.
Ontological Crises
—Peter de Blanc, “Ontological Crises in Artificial Agents’ Value Systems”, 2010
If you know a mapping between objects from human to AI ontology, you could find the mapping from the (consistent) human probability simplex to the AI simplex?
Discrete Case
A node splits in two or more, or two or more nodes get merged. If the then resulting graph isn't a path graph, it can be turned with the method described above.
Further Questions
Acknowledgements
Thanks to Miranda Dixon-Luinenburg for finding some typos.