Do you happen to know why this happens?
I'm not using any pull-up resistors also. Should I ?
2k2 means 2.2 kOhm and 4k7 means 4.7 kOhm. The bus capacity is added up from the capacities of the connected devices plus a bit for the bus cables. If you don't have the capacity per meter cable of the wires you use, guess it from a similar cable. Usually it's a few pF per dm. If you have a scope you don't have to calculate the bus capacity, you can simply try different resistor values and have a look at the changes of the signal picture.In your case I would try with 2k2, this probably fits your needs.
Thank you. Is this how I should connect the resistors?
Should the GND of the compass be connected to Arduino's GND in order to work as a slave device, just like with the slave Arduino? Cause currently I have it on the GND of the circuit.