A chain grown from its ends gets lost
Worth reading first: The format that does not notice the dimension · A block nobody can call sparse · A model that is a rational function.
The order of the indices is not free wrote one tensor of eight indices, each taking three values, in train format in several orders. Every rank in a train is the rank across one cut, between the indices to the left of it and those to the right, so which indices are written next to which decides the ranks. A tensor made of four couplings between separated pairs stored 8,322 numbers in its natural order and 72 with each pair side by side. A median random order stored 1,584. And a greedy chain built from a table of pairwise slices, one small matrix per pair of indices read through a fixed base point, found the cheap order on all three of its tensors from under a twentieth of the entries.
The orders it called best had been chosen by construction and then confirmed by the chain. So the essay signed two predictions. An exhaustive search across all orders would find nothing below 72 on the pairs and nothing below 180 on a shuffled chain of seven couplings, so that those are true minima. And on a mixed tensor, two pairs and a chain of four, the greedy order would be within a factor of two of the true least.
The question is an old one in a new format. The same matrix numbered twice found a hierarchical matrix’s off-diagonal ranks, and so its whole cost, decided by how its rows were numbered, with nothing about the operator changed. A train is more exposed to the same choice, because its cores multiply the ranks on both sides of them, so one coupling placed badly is paid for at every cut it crosses rather than once. And a Tucker format, which a decomposition made only of SVDs built from one unfolding per index, has no order to choose at all: every index is cut from the rest separately, which is its advantage and the reason its core grows as the product of all the ranks.
The search is affordable because the rank across a cut depends on the set of indices to its left and not on their order. Eight indices have at most 128 such sets up to complement, so every one of the 20,160 orders, an order and its reverse being the same train, is read from 128 numerical ranks computed once.
The two minima are true
On the four separated pairs the least over every order is 72 entries, as predicted, and 192 orders reach it. None stores between 72 and 144; the next level up is far above, and the median is 1,584. On the shuffled chain the least is 180, as predicted, reached by four orders only, and 32 orders store within twice it. The worst order of either tensor stores 8,322, more than the 6,561 entries of the array itself. The first half of the prediction holds exactly, and the greedy chain sits at the least on both.
The count of best orders is worth a moment. A tensor of four independent pairs has ways to order the pairs and ways to orient them, 384 orders, which is 192 once a train and its reverse are identified. Every one of them stores 72, and nothing else does. So the best order is not a point but a class, and the class is exactly the set of orders that keep each coupling’s two indices adjacent. The shuffled chain has only its two directions and two near-equivalents, because a chain of seven couplings can be laid down without crossing in very few ways.
The mixed tensor’s least is 108 entries, reached by 96 orders, with a median of 1,908. It is cheaper than the chain because it has fewer couplings and dearer than the pairs because one coupling more must cross a cut somewhere. Ninety-six is more than the 24 arrangements of the three pieces and their orientations, because a cut with a single index on one side has rank at most three whatever crosses it: near either end of the train, an index can sit one place away from its partner at no cost, and the extra orders are those swaps.
The greedy chain misses on half of one tensor
The mixed tensor is one tensor, but its pieces can sit on the eight indices in many ways. Six shuffles place the two pairs and the chain of four on six different sets of index names. Since renaming the indices only renames the orders, each of the six has the same least, 108, reached by the same number of orders, and the same distribution of storage over all 20,160. The greedy chain reads the slice table and builds an order on each.
On shuffles 2, 3 and 6 the greedy chain stores 108, the least. On shuffles 1, 4 and 5 it stores 396, three and two-thirds times the least. The prediction of a factor of two fails on half of the placements, and it fails on a tensor whose six placements are the same problem. Nothing about the couplings differs between a shuffle the chain gets right and one it gets wrong; only the labels on the indices do, and those enter the chain through the order in which it breaks ties between couplings of equal strength.
Every coupling here is the same function, , so the slice table holds five entries of the same size, one for each coupling, and twenty-three near zero. The greedy rule starts at the strongest pair in the table, and with five equal candidates the first in index order wins. When that is one of the chain’s three couplings, the chain grows correctly in both directions, finishes, and then appends the pairs. When it is one of the two separated pairs, there is nothing coupled to either end of it, the rule picks the strongest of the near-zero entries, and it attaches an index from the middle of the chain of four. From then on the chain’s other couplings can only be reached through an end, and one of them never is.
What the lost chain costs at each cut
On the first shuffle the greedy chain’s order is 0, 4, 1, 2, 6, 3, 5, 7. The couplings are the pairs (1, 2) and (3, 6) and the chain 0–4–5–7. Its ranks across the seven cuts are 3, 3, 9, 3, 9, 3, 3. Each coupling has rank three, so a cut crossed by one coupling has rank three and a cut crossed by two has rank nine, and the chain’s link from 4 to 5 crosses every cut between positions two and six, where it meets each of the two pairs in turn. The linked paths’ order, 0, 4, 5, 7, 1, 2, 6, 3, has ranks 3, 3, 3, 1, 3, 1, 3: the chain first, then each pair, with a rank of one at each cut between pieces because nothing crosses it.
This is the arithmetic that the format that does not notice the dimension introduced, applied to a bad order: storage is a sum over cores of the product of the ranks on either side, so the two cuts at rank nine cost far more than their share, and 396 against 108 is the price of one coupling stretched across two others.
Linking couplings into paths
A rule that cannot get lost has to treat the couplings as what they are, edges of a graph on the indices, and lay the graph down without crossing. That is a known problem in another form: an order in which each index’s strongest couplings are its neighbours is a path through the graph, and a set of pieces is a set of paths. The rule used here is the obvious greedy for that: take the couplings strongest first, keep one unless it would give an index a third neighbour or close a loop, and finally lay the resulting paths end to end in any order. It reads exactly the same slice table as the chain.
It finds the least on all eight tensors: 72 on the pairs, 180 on the shuffled chain and 108 on every placement of the mixed one. It cannot be misled by a tie in the way the chain is, because it never commits to an end; a pair accepted first is simply a finished path of two, and the chain’s couplings join each other whenever they are reached. Its order on the first shuffle, the one drawn above, puts the chain of four first and the pairs after it, which is one of the 96 best orders.
There is a strong resemblance here to choosing an elimination order for a sparse matrix. The least fill there is measured a minimum-degree ordering against the true least fill on graphs small enough to search, and eliminating a vertex is a graph operation is the reason an ordering problem on a matrix becomes one on a graph. In both settings a local rule built for the easy cases is right on many inputs and wrong on others that differ from them only in labelling, and a search small enough to be exhaustive is the only way to tell which is which.
The search does not have to be a search
The exhaustive reading suggests something stronger than either rule. The storage of a train is a sum over its cores, and the core between the cut after the first indices and the cut after the first costs , where is the set of indices to the left and the next one. That cost depends on two sets and on nothing about the order inside them. So the least storage over every order is a shortest path through the subsets of the indices, from the empty set to the full one, adding one index at each step, with the cost of each step read from two ranks. At eight indices that is 256 subsets and 2,048 steps against 20,160 orders, and the 254 nonempty proper subsets are the unfoldings the memo already held.
The shortest path gives the exhaustive least on all eight tensors: 72, 180 and 108 six times. It is exact rather than heuristic, and its cost grows as rather than as , so at twelve indices it is 49,152 steps against 240 million orders, and at sixteen about a million against . The price that does grow is the unfoldings: each of the subsets needs one numerical rank of a matrix with up to rows, which at sixteen indices of three values is a matrix of 6,561 by 6,561 for the balanced cuts. A slice table of pairs reads under a twentieth of the tensor; the subset path reads every unfolding, which is the whole tensor many times over. So the two are not competitors at scale. The slice rules are what a code can afford on a tensor too large to hold, and the subset path is what says, on a tensor small enough to hold, whether a slice rule was right.
How rare a good order is
The other reason the search matters is the scale of what a rule is choosing among. On the pairs, 0.95 per cent of orders are within twice the least, and all of those are at the least. On the chain it is 0.16 per cent, 32 orders. On the mixed tensor 1.43 per cent, 288 orders. A random order is within a factor of two of the least about once in a hundred tries at best, and the median order stores ten to twenty times the least. A rule that is right on half its inputs and a factor of four out on the rest is far better than chance, and that is the reason a greedy chain looked so good on the three tensors it was first tried on. It is not the same as a rule that is right.
Five indices are cheaper than two found that reshaping a matrix into more indices can lower its cost dramatically; the price of that advice is an order to choose, and the chance of a good one by accident falls as the indices multiply. Eight indices give 20,160 orders. Twelve give about 240 million, and at that size no search is exhaustive and every claim about a rule is a claim about the cases it was tried on.
What this measured and what it did not
Every tensor here is a product of couplings between pairs of indices, all with the same smooth function, on a grid of three points per index, with ranks read at a relative tolerance of . That is the setting in which the slice table is clean: five large entries and twenty-three small. With couplings of different strengths, ties would be rare and the greedy chain’s choice of starting pair would be decided by strength rather than by labels; whether it then finds the least more often is a separate measurement and was not made. Couplings of more than two indices at once, which no pairwise slice can show, were not tried, and the earlier essay’s first open question about them stands.
The tolerance matters too, and in a known direction. The digit that costs more than the tensor found that each crossing coupling is charged again for every digit asked of the train, so a bad order’s penalty over a good one grows as the tolerance tightens. With three points per index a coupling’s rank cannot exceed three, so on these tensors the tolerance has nothing left to charge and the ratio of 396 to 108 holds at any tolerance below . On a finer grid each coupling’s rank would rise with the digits asked, and a cut where two couplings cross pays the product of the two, so a bad order’s penalty would grow with the accuracy as well as with the number of couplings it stretches.
The path rule is a greedy rule as well. It is right on all eight tensors here, which are made of paths, and a tensor whose coupling graph is a tree with a branch, or a cycle, cannot be laid down as paths without some coupling crossing cuts; what the rule does then is open. What is firm is that 72 and 180 are minima, that the best orders are classes of 192, 4 and 96 rather than single orders, and that the earlier chain’s success on its three tensors was in part the luck of its labels.
Still open: a branch, and couplings of unequal strength
A coupling graph with a branch. Take three couplings meeting at one index, a star, plus a pair elsewhere. No order keeps all three of the star’s couplings adjacent, so at least one crosses a cut. The prediction with a sign is that the exhaustive least then puts the star’s centre between two of its leaves with the third leaf adjacent on one side, so that one coupling crosses exactly one extra cut, and that the path rule, which must drop one of the star’s couplings to keep degrees at two, finds that least on every placement, while the greedy chain is within twice it on fewer than four of six.
Unequal strengths. Give the five couplings of the mixed tensor strengths spread over a factor of ten, so that the slice table has no ties. The prediction is that the greedy chain then succeeds exactly on the placements where the strongest coupling belongs to the chain of four, three in five of random strength assignments, and that the path rule succeeds on all, so that removing the ties removes the dependence on labels and leaves the dependence on which piece happens to be strongest.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- A compression of 10¹⁴ that still does not fit — both name low-rank approximation, tensor train, unfolding
- A nearest point that is not there — both name low-rank approximation, numerical rank, unfolding
- A rank that is not a property of the tensor — both name low-rank approximation, numerical rank, unfolding
- A factorisation that is unique for once — both name low-rank approximation, unfolding
- A geometry setting that is a second accuracy — both name low-rank approximation, numerical rank
- A good curve and a bad verdict — both name low-rank approximation, numerical rank
Named objects
A flat tag is an object no other essay names yet.
Fill-reducing orderingGreedy algorithmLow-rank approximationNumerical rankTensor trainUnfolding