Is there a philosophical definition for "difference" and "similarity"? When are 2 logically valid arguments "different" or "similar"?
There is Liebniz's notion of indiscernability; in that if two things have all the same properties then they are indiscernible; but being indiscernible doesn't neccessarily mean identical; though it might do.
This is qualified on several ways; in one direction by not taking position and orientation in space and time as relevant: this cup now and this cup then being the same cup.
In mathematics a similar idea is distinguished as an isomorphism or equivalence.
The contrapositive of this notion gives a notion of difference.
I think there is no philosophical or logical sense in which two things are simply similar. Instead, things are similar, or not, in some respect, or in some regard. For example, A yellow cube is similar to a yellow sphere with regard to color, but dissimilar with regard to shape. Two logically valid arguments may be similar in various ways: in regard to logical form (e.g. modus ponens), in being sound (having true premises), in having negative premises, in having the same number of premises, etc.
One may neatly axiomize "similarity" in modal type theory, which is type theory equipped with an idempotent (co-)monad D. This being idempotent, it necessarily acts by "projecting out" some details of the type. Hence given two types X and Y, then asking whether they are similar in that they are equal after forgetting the details projected out by P is asking wehther D(X) = D(Y).
For instance in a homotopy type system equipped with a shape modality (some details on what this means are here, then all types have the interpretation of differential geometric spaces, and the shape operator forgets all the differential geometric structure and remembers just the homotopy theoretic shape (aka weak homotopy type).
For instance the circle S^1 and the cyclinder S^1 x [0,1] are different types in this context, as they are not diffeomorphic, but clearly they are similar in some sense. One such sense is that they have the same homotopy-theoretic shape:
Shape(S^1) = Shape(S^1 x [0,1]).
Of course a different kind of modal operator encodes a different kind of similarity this way. But this makes very good sense: a notion of similarity depends of specifying the intended "mode" of similarity.
This is exactly what mathematicians call "a logic". Two propositions are equivalent in a given logic if when all the variables are appropriately filled in, they always define the same set of things. Two things are the same according to a given logic if they satisfy all of the same propositions.
Most people think of standard first-order logic, where all variables are able to take all values and all true propositions are equal and the rest (the false propositions) are also equal. But if you want to study something more like human thought than Platonic definitions, you have more subtle rules.
So there is not really a definition for 'similarity' across the whole of philosophy, but there is a recognition that studying different notions of similarity is important enough to constitute an entire subfield.
From a modern formalist mathematical point of view, this study of logics is the whole of mathematics. So some philosophers consider that subfield larger or smaller depending on their ontology.