  We introduce a method, MMD-B-Fair, to learn fair representations of data via
kernel two-sample testing. We find neural features of our data where a maximum
mean discrepancy (MMD) test cannot distinguish between representations of
different sensitive groups, while preserving information about the target
attributes. Minimizing the power of an MMD test is more difficult than
maximizing it (as done in previous work), because the test threshold's complex
behavior cannot be simply ignored. Our method exploits the simple asymptotics
of block testing schemes to efficiently find fair representations without
requiring complex adversarial optimization or generative modelling schemes
widely used by existing work on fair representation learning. We evaluate our
approach on various datasets, showing its ability to ``hide'' information about
sensitive attributes, and its effectiveness in downstream transfer tasks.
